Fixed code example in README

A call to the `format!` macro was implying the use of a named argument
called `name` in the format string, but the argument wasn't specified. I fixed
this by using the simple {} notation in the format string and passing
the `name` variable as a second argument.
This commit is contained in:
Christopher Jarville 2022-06-17 10:25:02 -06:00
parent 265fa0d050
commit cfe3933e6c
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ use actix_web::{get, web, App, HttpServer, Responder};
#[get("/hello/{name}")] #[get("/hello/{name}")]
async fn greet(name: web::Path<String>) -> impl Responder { async fn greet(name: web::Path<String>) -> impl Responder {
format!("Hello {name}!") format!("Hello {}!", name)
} }
#[actix_web::main] // or #[tokio::main] #[actix_web::main] // or #[tokio::main]