Browse Source

xtask: clippy warnings

Alessandro Decina 3 years ago
parent
commit
2d16843d5d
3 changed files with 4 additions and 7 deletions
  1. 1 4
      xtask/src/codegen/aya.rs
  2. 2 2
      xtask/src/codegen/helpers.rs
  3. 1 1
      xtask/src/codegen/mod.rs

+ 1 - 4
xtask/src/codegen/aya.rs

@@ -49,10 +49,7 @@ fn codegen_internal_btf_bindings(opts: &Options) -> Result<(), anyhow::Error> {
         .to_string();
 
     // write the bindings, with the original helpers removed
-    write_to_file(
-        &generated.join("btf_internal_bindings.rs"),
-        &bindings.to_string(),
-    )?;
+    write_to_file(&generated.join("btf_internal_bindings.rs"), &bindings)?;
 
     Ok(())
 }

+ 2 - 2
xtask/src/codegen/helpers.rs

@@ -60,11 +60,11 @@ pub fn expand_helpers(helpers: &[Helper<'_>]) -> TokenStream {
     tokens.append_all(
         helpers
             .iter()
-            .filter(|h| h.ident.to_string() != "bpf_trace_printk")
+            .filter(|h| *h.ident != "bpf_trace_printk")
             .map(expand_helper),
     );
 
-    return tokens;
+    tokens
 }
 
 pub fn expand_helper(helper: &Helper<'_>) -> TokenStream {

+ 1 - 1
xtask/src/codegen/mod.rs

@@ -6,7 +6,7 @@ use std::path::PathBuf;
 
 use structopt::StructOpt;
 
-const SUPPORTED_ARCHS: &'static [Architecture] = &[
+const SUPPORTED_ARCHS: &[Architecture] = &[
     Architecture::X86_64,
     Architecture::ARMv7,
     Architecture::AArch64,