From 57c1479f279daa3455d650ab60cfaf50efe06ec2 Mon Sep 17 00:00:00 2001 From: Phani Sajja Date: Fri, 3 May 2024 17:35:05 +0530 Subject: [PATCH] fix clippy (toolchain 1.78.0) Signed-off-by: Phani Sajja --- src/check/artifact/package.rs | 2 +- src/check/artifact/script.rs | 12 ++++-------- src/check/mod.rs | 1 + src/core/artifact.rs | 4 ++-- src/core/dep_graph.rs | 1 + src/store/mod.rs | 1 + 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/check/artifact/package.rs b/src/check/artifact/package.rs index b94d8f7..16b1bf6 100644 --- a/src/check/artifact/package.rs +++ b/src/check/artifact/package.rs @@ -524,7 +524,7 @@ impl ArtifactCheck for PackageBeforeCheck { .iter() .filter_map(|search_path| { if let Some(dep_ident) = search_path.package_ident(artifact_context.target) { - if tdep_artifacts.get(&dep_ident).is_some() { + if tdep_artifacts.contains_key(&dep_ident) { let artifact_ctx = artifact_cache.artifact(&dep_ident).unwrap(); if let Some(artifact_ctx) = &artifact_ctx { for (elf_path, elf_metadata) in &artifact_ctx.elfs { diff --git a/src/check/artifact/script.rs b/src/check/artifact/script.rs index 3a535c2..dc6a787 100644 --- a/src/check/artifact/script.rs +++ b/src/check/artifact/script.rs @@ -559,20 +559,16 @@ impl ArtifactCheck for ScriptCheck { used_deps.insert(interpreter_artifact_ctx.id.clone()); if interpreter_artifact_ctx .elfs - .get(command.as_path()) - .is_some() + .contains_key(command.as_path()) || interpreter_artifact_ctx .scripts - .get(command.as_path()) - .is_some() + .contains_key(command.as_path()) || interpreter_artifact_ctx .links - .get(command.as_path()) - .is_some() + .contains_key(command.as_path()) || interpreter_artifact_ctx .machos - .get(command.as_path()) - .is_some() + .contains_key(command.as_path()) { let mut interpreter_listed = false; for intermediate in intermediates.iter() { diff --git a/src/check/mod.rs b/src/check/mod.rs index d9d7a4e..2652757 100644 --- a/src/check/mod.rs +++ b/src/check/mod.rs @@ -528,6 +528,7 @@ pub(crate) trait SourceCheck { plan_context: &PlanContext, source_context: &SourceContext, ) -> Vec; + #[allow(dead_code)] fn source_context_check_with_artifact( &self, plan_config: &PlanContextConfig, diff --git a/src/core/artifact.rs b/src/core/artifact.rs index 297ad1f..a2ec289 100644 --- a/src/core/artifact.rs +++ b/src/core/artifact.rs @@ -1185,7 +1185,7 @@ impl ArtifactContext { }; if let Some(next_artifact_ctx) = link.package_ident(artifact_ctx.target) { if next_artifact_ctx == artifact_ctx.id - && artifact_ctx.links.get(&link).is_none() + && !artifact_ctx.links.contains_key(&link) { resolved_path = link.to_path_buf(); current_artifact = None; @@ -1262,7 +1262,7 @@ impl ArtifactContext { }; if let Some(next_artifact_ctx) = link.package_ident(artifact_ctx.target) { if next_artifact_ctx == artifact_ctx.id - && artifact_ctx.links.get(&link).is_none() + && !artifact_ctx.links.contains_key(&link) { resolved_path = link.to_path_buf(); intermediate_paths.push(resolved_path.clone()); diff --git a/src/core/dep_graph.rs b/src/core/dep_graph.rs index c85398c..4519d7b 100644 --- a/src/core/dep_graph.rs +++ b/src/core/dep_graph.rs @@ -141,6 +141,7 @@ impl Dependency { } #[derive(Debug, PartialEq, Eq)] +#[allow(dead_code)] pub(crate) struct DependencyArtifactUpdated { latest_dep_artifact: PlanContextLatestArtifact, latest_plan_artifact: PlanContextLatestArtifact, diff --git a/src/store/mod.rs b/src/store/mod.rs index 146acad..c386cbd 100644 --- a/src/store/mod.rs +++ b/src/store/mod.rs @@ -126,6 +126,7 @@ impl AsRef for InvalidPackageSourceArchiveStorePath { } #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] +#[allow(dead_code)] pub(crate) struct PackageSourceLicenseStorePath(PathBuf); impl AsRef for PackageSourceLicenseStorePath {