From cd56883197a8d9385f75c2ea018e7e7f378c129e Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 14 Jan 2025 21:58:10 +0500 Subject: [PATCH] Clippy (#499) --- ntex-service/src/lib.rs | 2 +- ntex/src/web/responder.rs | 2 +- ntex/src/web/types/json.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ntex-service/src/lib.rs b/ntex-service/src/lib.rs index 6e3babd0..df444562 100644 --- a/ntex-service/src/lib.rs +++ b/ntex-service/src/lib.rs @@ -256,7 +256,7 @@ pub trait ServiceFactory { } } -impl<'a, S, Req> Service for &'a S +impl Service for &S where S: Service, { diff --git a/ntex/src/web/responder.rs b/ntex/src/web/responder.rs index a8f1bf42..55e3a12f 100644 --- a/ntex/src/web/responder.rs +++ b/ntex/src/web/responder.rs @@ -143,7 +143,7 @@ impl Responder for String { } } -impl<'a, Err: ErrorRenderer> Responder for &'a String { +impl Responder for &String { async fn respond_to(self, _: &HttpRequest) -> Response { Response::build(StatusCode::OK) .content_type("text/plain; charset=utf-8") diff --git a/ntex/src/web/types/json.rs b/ntex/src/web/types/json.rs index 2f429791..cddbfd70 100644 --- a/ntex/src/web/types/json.rs +++ b/ntex/src/web/types/json.rs @@ -294,7 +294,7 @@ where let json = if let Ok(Some(mime)) = req.mime_type() { mime.subtype() == mime::JSON || mime.suffix() == Some(mime::JSON) - || ctype.as_ref().map_or(false, |predicate| predicate(mime)) + || ctype.as_ref().is_some_and(|predicate| predicate(mime)) } else { false };