From 9be18a67c5d9267f7f53333c75f3c232767d205d Mon Sep 17 00:00:00 2001 From: Axel Faure Date: Sat, 7 Sep 2024 15:42:15 +0200 Subject: [PATCH] Try to fix clippy --- src/web/qs.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/web/qs.rs b/src/web/qs.rs index b283ee9..a0bf198 100644 --- a/src/web/qs.rs +++ b/src/web/qs.rs @@ -23,7 +23,7 @@ impl QsQuery { } impl QsQuery { - pub fn from_query(query_str: &str) -> Result { + pub fn from_(query_str: &str) -> Result { serde_urlencoded::from_str::(query_str) .map(Self) .map_err(QueryPayloadError::Deserialize) @@ -41,10 +41,10 @@ where #[inline] fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future { let req_copy = req.clone(); - let qs_query_config = req.app_data::(); - let error_handler = qs_query_config.and_then(|c| c.err_handler.clone()); + let qs__config = req.app_data::(); + let error_handler = qs__config.and_then(|c| c.err_handler.clone()); let default_qs_config = Config::default(); - let qs_config = qs_query_config + let qs_config = qs__config .map(|config| &config.qs_config) .unwrap_or(&default_qs_config); @@ -206,24 +206,24 @@ mod test { Ok(()) } - async fn test_handler(_query: QsQuery) -> HttpResponse { + async fn test_handler(_: QsQuery) -> HttpResponse { HttpResponse::Ok().finish() } - async fn test_form_handler(_query: Form) -> HttpResponse { + async fn test_form_handler(_: Form) -> HttpResponse { HttpResponse::Ok().finish() } - async fn test_handler_with_context(_query: QsQuery) -> HttpResponse { + async fn test_handler_with_context(_: QsQuery) -> HttpResponse { HttpResponse::Ok().finish() } - async fn test_form_handler_with_context(_query: Form) -> HttpResponse { + async fn test_form_handler_with_context(_: Form) -> HttpResponse { HttpResponse::Ok().finish() } #[tokio::test] - async fn test_simple_query_validation() { + async fn test_simple__validation() { let app = init_service(App::new().service(resource("/").route(post().to(test_handler)))).await; let req = TestRequest::post().uri("/?age=24").to_request(); @@ -236,7 +236,7 @@ mod test { } #[tokio::test] - async fn test_query_validation_custom_config() { + async fn test__validation_custom_config() { let app = init_service( App::new() .app_data( @@ -257,7 +257,7 @@ mod test { } #[tokio::test] - async fn test_query_validation_with_context() { + async fn test__validation_with_context() { let number_context = NumberContext { min: 25 }; let app = init_service( App::new() @@ -276,7 +276,7 @@ mod test { } #[tokio::test] - async fn test_query_validation_with_missing_context() { + async fn test__validation_with_missing_context() { let app = init_service(App::new().service(resource("/").route(post().to(test_handler_with_context)))).await; let req = TestRequest::post().uri("/?age=24").to_request();