Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings #1026

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading