Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Nov 23, 2023
1 parent 742cce0 commit bfd09a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions crates/header-translator/src/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,14 +957,14 @@ impl Stmt {
_ => error!("unknown"),
});

return vec![Self::StructDecl {
vec![Self::StructDecl {
id,
encoding_name,
availability,
boxable,
fields,
sendable,
}];
}]
}
EntityKind::EnumDecl => {
// Enum declarations show up twice for some reason, but
Expand Down Expand Up @@ -1373,8 +1373,9 @@ impl fmt::Display for Stmt {
};

let (superclass, superclasses_rest) = superclasses.split_at(1);
let (superclass, superclass_generics) =
superclass.get(0).expect("must have a least one superclass");
let (superclass, superclass_generics) = superclass
.first()
.expect("must have a least one superclass");

writeln!(f, "{macro_name}!(")?;
writeln!(f, " {derives}")?;
Expand Down
2 changes: 1 addition & 1 deletion crates/header-translator/src/unexposed_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ fn get_argument_tokens<'a>(entity: &Entity<'a>) -> Vec<Token<'a>> {
// Remove the macro name from the full macro tokens
let name_ranges = entity.get_name_ranges();
assert_eq!(name_ranges.len(), 1, "macro name ranges");
let name_range = name_ranges.get(0).unwrap();
let name_range = name_ranges.first().unwrap();
let range = entity.get_range().expect("macro range");

let mut tokens = SourceRange::new(name_range.get_end(), range.get_end()).tokenize();
Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//! ```
#![doc = include_str!("../../examples/introspection.rs")]
//! ```
#![allow(clippy::missing_panics_doc)]

#[cfg(feature = "malloc")]
use alloc::vec::Vec;
Expand Down

0 comments on commit bfd09a5

Please sign in to comment.