1
0
mirror of https://github.com/actix/actix-website synced 2025-01-22 16:15:56 +01:00

clarify what happens when extractor fails

This commit is contained in:
Rob Ede 2021-01-17 16:47:27 +00:00 committed by GitHub
parent e7950a7272
commit 4aece987ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,8 @@ struct Info {
username: String, username: String,
} }
// this handler get called only if the request's query contains `username` field // this handler gets called if the query deserializes into `Info` successfully
// otherwise a 400 Bad Request error response is returned
#[get("/")] #[get("/")]
async fn index(info: web::Query<Info>) -> String { async fn index(info: web::Query<Info>) -> String {
format!("Welcome {}!", info.username) format!("Welcome {}!", info.username)