From 4aece987accd625e51f2394bc3dff363f77cc3fd Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 17 Jan 2021 16:47:27 +0000 Subject: [PATCH] clarify what happens when extractor fails --- examples/extractors/src/query.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/extractors/src/query.rs b/examples/extractors/src/query.rs index f540e80..d029a71 100644 --- a/examples/extractors/src/query.rs +++ b/examples/extractors/src/query.rs @@ -7,7 +7,8 @@ struct Info { 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("/")] async fn index(info: web::Query) -> String { format!("Welcome {}!", info.username)