diff --git a/axum-macros/src/debug_handler.rs b/axum-macros/src/debug_handler.rs index 66abd6ff..74366aa4 100644 --- a/axum-macros/src/debug_handler.rs +++ b/axum-macros/src/debug_handler.rs @@ -365,7 +365,7 @@ fn check_future_send(item_fn: &ItemFn) -> TokenStream { match &item_fn.sig.output { syn::ReturnType::Default => { return syn::Error::new_spanned( - &item_fn.sig.fn_token, + item_fn.sig.fn_token, "Handlers must be `async fn`s", ) .into_compile_error(); diff --git a/axum/benches/benches.rs b/axum/benches/benches.rs index 9cf47e29..13295a3c 100644 --- a/axum/benches/benches.rs +++ b/axum/benches/benches.rs @@ -162,19 +162,19 @@ impl BenchmarkBuilder { cmd.arg("--host"); cmd.arg(format!("http://{}{}", addr, self.path.unwrap_or(""))); - cmd.args(&["--connections", "10"]); - cmd.args(&["--threads", "10"]); + cmd.args(["--connections", "10"]); + cmd.args(["--threads", "10"]); if on_ci() { // don't slow down CI by running the benchmarks for too long // but do run them for a bit - cmd.args(&["--duration", "1s"]); + cmd.args(["--duration", "1s"]); } else { - cmd.args(&["--duration", "10s"]); + cmd.args(["--duration", "10s"]); } if let Some(method) = self.method { - cmd.args(&["--method", method]); + cmd.args(["--method", method]); } for (key, value) in self.headers.into_iter().flatten() { @@ -183,7 +183,7 @@ impl BenchmarkBuilder { } if let Some(body) = self.body { - cmd.args(&["--body", body]); + cmd.args(["--body", body]); } eprintln!("Running {:?} benchmark", self.name); @@ -209,7 +209,7 @@ impl BenchmarkBuilder { fn install_rewrk() { println!("installing rewrk"); let mut cmd = Command::new("cargo"); - cmd.args(&[ + cmd.args([ "install", "rewrk", "--git", diff --git a/axum/src/extract/matched_path.rs b/axum/src/extract/matched_path.rs index 1e35544e..fa4d50b3 100644 --- a/axum/src/extract/matched_path.rs +++ b/axum/src/extract/matched_path.rs @@ -60,7 +60,7 @@ pub struct MatchedPath(pub(crate) Arc); impl MatchedPath { /// Returns a `str` representation of the path. pub fn as_str(&self) -> &str { - &*self.0 + &self.0 } } diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index a48f9a73..dbc38905 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -579,7 +579,7 @@ fn sign(key: &[u8]) -> HeaderValue { let mut sha1 = Sha1::default(); sha1.update(key); sha1.update(&b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"[..]); - let b64 = Bytes::from(base64::encode(&sha1.finalize())); + let b64 = Bytes::from(base64::encode(sha1.finalize())); HeaderValue::from_maybe_shared(b64).expect("base64 is a valid value") } diff --git a/axum/src/util.rs b/axum/src/util.rs index b494159c..f7fc6ae1 100644 --- a/axum/src/util.rs +++ b/axum/src/util.rs @@ -16,7 +16,7 @@ impl PercentDecodedStr { } pub(crate) fn as_str(&self) -> &str { - &*self.0 + &self.0 } pub(crate) fn into_inner(self) -> Arc {