Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Nov 4, 2024
1 parent 89a9faa commit 9c3e4bd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/bindgen/bitflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/ir/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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('=') {
Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<F: Write> Write for InnerWriter<'_, '_, F> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
let writer = &mut self.0;

Expand Down

0 comments on commit 9c3e4bd

Please sign in to comment.