diff --git a/core/codegen/src/attribute/route/mod.rs b/core/codegen/src/attribute/route/mod.rs index 50610249..b2979d3f 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.as_ref().map(|m| m.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(); diff --git a/core/lib/src/listener/tcp.rs b/core/lib/src/listener/tcp.rs index 61252c7d..bdf337ee 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 a6992a7a..37a22b9d 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")))?;