From 9fa19570a1a228e93ce79083d165f720bd41368b Mon Sep 17 00:00:00 2001 From: sheshnath-at-knoldus Date: Thu, 1 Aug 2024 18:39:08 +0530 Subject: [PATCH 1/2] fixed clippy warnings --- core/codegen/src/attribute/route/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/codegen/src/attribute/route/mod.rs b/core/codegen/src/attribute/route/mod.rs index cb501e43ed..dd60aa4ba6 100644 --- a/core/codegen/src/attribute/route/mod.rs +++ b/core/codegen/src/attribute/route/mod.rs @@ -266,8 +266,12 @@ fn internal_uri_macro_decl(route: &Route) -> TokenStream { route.attr.method.0.hash(&mut hasher); route.attr.uri.path().hash(&mut hasher); route.attr.uri.query().hash(&mut hasher); - route.attr.data.as_ref().map(|d| d.value.hash(&mut hasher)); - route.attr.format.as_ref().map(|f| f.0.hash(&mut hasher)); + if let Some(data) = &route.attr.data { + data.value.hash(&mut hasher); + } + if let Some(format) = &route.attr.format { + format.0.hash(&mut hasher); + } }); let route_uri = route.attr.uri.to_string(); From 991210595753a4004c4c64702484ad7017b06b1f Mon Sep 17 00:00:00 2001 From: sheshnath-at-knoldus Date: Fri, 2 Aug 2024 13:31:43 +0530 Subject: [PATCH 2/2] fixed clippy warning, as this expression creates a reference which is immediately dereferenced by the compiler --- core/lib/src/listener/tcp.rs | 2 +- core/lib/src/listener/unix.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lib/src/listener/tcp.rs b/core/lib/src/listener/tcp.rs index 61252c7d79..bdf337ee18 100644 --- a/core/lib/src/listener/tcp.rs +++ b/core/lib/src/listener/tcp.rs @@ -24,7 +24,7 @@ impl Bind for TcpListener { type Error = Either; async fn bind(rocket: &Rocket) -> Result { - let endpoint = Self::bind_endpoint(&rocket)?; + let endpoint = Self::bind_endpoint(rocket)?; let addr = endpoint.tcp() .ok_or_else(|| io::Error::other("internal error: invalid endpoint")) .map_err(Right)?; diff --git a/core/lib/src/listener/unix.rs b/core/lib/src/listener/unix.rs index a6992a7acc..37a22b9dda 100644 --- a/core/lib/src/listener/unix.rs +++ b/core/lib/src/listener/unix.rs @@ -75,7 +75,7 @@ impl Bind for UnixListener { type Error = Either; async fn bind(rocket: &Rocket) -> Result { - let endpoint = Self::bind_endpoint(&rocket)?; + let endpoint = Self::bind_endpoint(rocket)?; let path = endpoint.unix() .ok_or_else(|| Right(io::Error::other("internal error: invalid endpoint")))?;