From 9c3e4bda0ef77f04d2d8e6273688491b3106a918 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Mon, 4 Nov 2024 13:49:46 +0900 Subject: [PATCH] Fix clippy warnings --- src/bindgen/bitflags.rs | 4 ++-- src/bindgen/ir/cfg.rs | 2 +- src/bindgen/parser.rs | 2 +- src/bindgen/rename.rs | 2 +- src/bindgen/writer.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bindgen/bitflags.rs b/src/bindgen/bitflags.rs index 2ca0be6c3..bc998e0a6 100644 --- a/src/bindgen/bitflags.rs +++ b/src/bindgen/bitflags.rs @@ -137,13 +137,13 @@ struct FlagValueFold<'a> { out_of_line: bool, } -impl<'a> FlagValueFold<'a> { +impl FlagValueFold<'_> { fn is_self(&self, ident: &syn::Ident) -> bool { ident == self.struct_name || ident == "Self" } } -impl<'a> Fold for FlagValueFold<'a> { +impl Fold for FlagValueFold<'_> { fn fold_expr(&mut self, node: syn::Expr) -> syn::Expr { // bitflags 2 doesn't expose `bits` publically anymore, and the documented way to // combine flags is using the `bits` method, e.g. diff --git a/src/bindgen/ir/cfg.rs b/src/bindgen/ir/cfg.rs index 65de1a2ff..e3d346c99 100644 --- a/src/bindgen/ir/cfg.rs +++ b/src/bindgen/ir/cfg.rs @@ -15,7 +15,7 @@ enum DefineKey<'a> { Named(&'a str, &'a str), } -impl<'a> DefineKey<'a> { +impl DefineKey<'_> { fn load(key: &str) -> DefineKey { // TODO: dirty parser if !key.contains('=') { diff --git a/src/bindgen/parser.rs b/src/bindgen/parser.rs index eb2ef2dc0..13fa3f7e4 100644 --- a/src/bindgen/parser.rs +++ b/src/bindgen/parser.rs @@ -106,7 +106,7 @@ struct Parser<'a> { out: Parse, } -impl<'a> Parser<'a> { +impl Parser<'_> { fn should_parse_dependency(&self, pkg_name: &str) -> bool { if self.parsed_crates.contains(pkg_name) { return false; diff --git a/src/bindgen/rename.rs b/src/bindgen/rename.rs index 6f4928ef7..6ba5935ae 100644 --- a/src/bindgen/rename.rs +++ b/src/bindgen/rename.rs @@ -15,7 +15,7 @@ pub enum IdentifierType<'a> { Enum, } -impl<'a> IdentifierType<'a> { +impl IdentifierType<'_> { fn to_str(self) -> &'static str { match self { IdentifierType::StructMember => "m", diff --git a/src/bindgen/writer.rs b/src/bindgen/writer.rs index f36757d26..1422726b2 100644 --- a/src/bindgen/writer.rs +++ b/src/bindgen/writer.rs @@ -21,7 +21,7 @@ pub enum ListType<'a> { /// A utility wrapper to write unbuffered data and correctly adjust positions. struct InnerWriter<'a, 'b: 'a, F: 'a + Write>(&'a mut SourceWriter<'b, F>); -impl<'a, 'b, F: Write> Write for InnerWriter<'a, 'b, F> { +impl Write for InnerWriter<'_, '_, F> { fn write(&mut self, buf: &[u8]) -> io::Result { let writer = &mut self.0;