Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Nov 5, 2022
1 parent 21475f9 commit 36f2499
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion axum-macros/src/debug_handler.rs
Expand Up @@ -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();
Expand Down
14 changes: 7 additions & 7 deletions axum/benches/benches.rs
Expand Up @@ -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() {
Expand All @@ -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);
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion axum/src/extract/matched_path.rs
Expand Up @@ -60,7 +60,7 @@ pub struct MatchedPath(pub(crate) Arc<str>);
impl MatchedPath {
/// Returns a `str` representation of the path.
pub fn as_str(&self) -> &str {
&*self.0
&self.0
}
}

Expand Down
2 changes: 1 addition & 1 deletion axum/src/extract/ws.rs
Expand Up @@ -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")
}

Expand Down
2 changes: 1 addition & 1 deletion axum/src/util.rs
Expand Up @@ -16,7 +16,7 @@ impl PercentDecodedStr {
}

pub(crate) fn as_str(&self) -> &str {
&*self.0
&self.0
}

pub(crate) fn into_inner(self) -> Arc<str> {
Expand Down

0 comments on commit 36f2499

Please sign in to comment.