mirror of https://github.com/fafhrd91/actix-web
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:
parent
265fa0d050
commit
cfe3933e6c
|
@ -58,7 +58,7 @@ use actix_web::{get, web, App, HttpServer, Responder};
|
|||
|
||||
#[get("/hello/{name}")]
|
||||
async fn greet(name: web::Path<String>) -> impl Responder {
|
||||
format!("Hello {name}!")
|
||||
format!("Hello {}!", name)
|
||||
}
|
||||
|
||||
#[actix_web::main] // or #[tokio::main]
|
||||
|
|
Loading…
Reference in New Issue