diff --git a/xtask/src/codegen/aya.rs b/xtask/src/codegen/aya.rs index 69d043ef..5a3e080c 100644 --- a/xtask/src/codegen/aya.rs +++ b/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(()) } diff --git a/xtask/src/codegen/helpers.rs b/xtask/src/codegen/helpers.rs index efc965ca..54c502b6 100644 --- a/xtask/src/codegen/helpers.rs +++ b/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 { diff --git a/xtask/src/codegen/mod.rs b/xtask/src/codegen/mod.rs index d9d66726..c363b193 100644 --- a/xtask/src/codegen/mod.rs +++ b/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,