Skip to content

Commit

Permalink
Merge pull request #376 from pacak/clippy
Browse files Browse the repository at this point in the history
Some clippy suggestions
  • Loading branch information
pacak authored Feb 13, 2025
2 parents 31e8fed + 960f289 commit e3d5d3e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ impl<'a> Asm<'a> {
}
}

impl<'a> Dumpable for Asm<'a> {
impl Dumpable for Asm<'_> {
type Line<'l> = Statement<'l>;

fn split_lines(contents: &str) -> anyhow::Result<Vec<Self::Line<'_>>> {
Expand Down
4 changes: 2 additions & 2 deletions src/asm/statements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn parse_data_dec(input: &str) -> IResult<&str, Directive> {
))
}

impl<'a> Statement<'a> {
impl Statement<'_> {
/// Should we skip it for --simplify output?
pub fn boring(&self) -> bool {
if let Statement::Directive(Directive::SetValue(_, _)) = self {
Expand Down Expand Up @@ -313,7 +313,7 @@ pub struct Loc<'a> {
pub extra: Option<&'a str>,
}

impl<'a> PartialEq for Loc<'a> {
impl PartialEq for Loc<'_> {
fn eq(&self, other: &Self) -> bool {
self.file == other.file && self.line == other.line
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub fn pick_dump_item<K: Clone>(
if filtered.is_empty() {
esafeprintln!("Can't find any items matching {function:?}");
} else {
suggest_name(&function, &fmt, filtered.iter().map(|x| x.0));
suggest_name(&function, fmt, filtered.iter().map(|x| x.0));
}
std::process::exit(1);
};
Expand All @@ -217,7 +217,7 @@ pub fn pick_dump_item<K: Clone>(
} else {
// Otherwise, print suggestions and exit
let items = items.keys();
suggest_name("", &fmt, items);
suggest_name("", fmt, items);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ fn locate_asm_path_via_artifact(artifact: &Artifact, expect_ext: &str) -> anyhow
if let Some(rlib_path) = artifact
.filenames
.iter()
.find(|f| f.extension().map_or(false, |e| e == "rlib"))
.find(|f| f.extension() == Some("rlib"))
{
let deps_dir = rlib_path.with_file_name("deps");

Expand Down Expand Up @@ -458,7 +458,7 @@ fn locate_asm_path_via_artifact(artifact: &Artifact, expect_ext: &str) -> anyhow
// if artifact.target.kind.iter().any(|k| k == "cdylib") {
if let Some(cdylib_path) = artifact.filenames.iter().find(|f| {
f.extension()
.map_or(false, |e| ["so", "dylib", "dll"].contains(&e))
.is_some_and(|e| ["so", "dylib", "dll"].contains(&e))
}) {
let deps_dir = cdylib_path.with_file_name("deps");
for entry in deps_dir.read_dir()? {
Expand Down

0 comments on commit e3d5d3e

Please sign in to comment.