mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-28 07:20:12 +01:00
Fix clippy lints
This commit is contained in:
parent
21475f94ff
commit
36f24990c8
5 changed files with 11 additions and 11 deletions
|
@ -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();
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue