diff --git a/Cargo.toml b/Cargo.toml index 3d872ef2a..dcfe42111 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,7 @@ codegen-units = 1 [workspace.lints.rust] unsafe_code = "forbid" missing_docs = "warn" -rust_2018_idioms = "warn" +rust_2018_idioms = { level = "warn", priority = -1 } trivial_casts = "warn" unused_lifetimes = "warn" unused_qualifications = "warn" @@ -88,7 +88,7 @@ unused_results = "warn" unused_extern_crates = "warn" unused_import_braces = "warn" unconditional_recursion = "warn" -unused = "warn" +unused = { level = "warn", priority = -1 } unused_allocation = "warn" unused_comparisons = "warn" unused_parens = "warn" @@ -97,15 +97,15 @@ unreachable_pub = "allow" [workspace.lints.clippy] redundant_pub_crate = "allow" -pedantic = "warn" -nursery = "warn" +pedantic = { level = "warn", priority = -1 } +nursery = { level = "warn", priority = -1 } # expect_used = "warn" # TODO! # unwrap_used = "warn" # TODO! enum_glob_use = "warn" -correctness = "warn" -suspicious = "warn" -complexity = "warn" -perf = "warn" +correctness = { level = "warn", priority = -1 } +suspicious = { level = "warn", priority = -1 } +complexity = { level = "warn", priority = -1 } +perf = { level = "warn", priority = -1 } cast_lossless = "warn" default_trait_access = "warn" doc_markdown = "warn" diff --git a/crates/core/src/repofile/keyfile.rs b/crates/core/src/repofile/keyfile.rs index 24c2946b6..3943ccc9e 100644 --- a/crates/core/src/repofile/keyfile.rs +++ b/crates/core/src/repofile/keyfile.rs @@ -14,7 +14,7 @@ use crate::{ pub(super) mod constants { /// Returns the number of bits of the given type. pub(super) const fn num_bits() -> usize { - std::mem::size_of::() * 8 + size_of::() * 8 } } diff --git a/crates/core/src/repofile/snapshotfile.rs b/crates/core/src/repofile/snapshotfile.rs index 75f6d3215..dcdda774e 100644 --- a/crates/core/src/repofile/snapshotfile.rs +++ b/crates/core/src/repofile/snapshotfile.rs @@ -1056,6 +1056,7 @@ impl StringList { } } + #[allow(clippy::needless_pass_by_ref_mut)] #[deprecated(note = "StringLists are now automatically sorted")] /// Sort the Strings in the [`StringList`] pub fn sort(&mut self) {} @@ -1149,10 +1150,11 @@ impl PathList { *path = sanitize_dot(path)?; } if self.0.iter().any(|p| p.is_absolute()) { - for path in &mut self.0 { - *path = - canonicalize(&path).map_err(SnapshotFileErrorKind::CanonicalizingPathFailed)?; - } + self.0 = self + .0 + .into_iter() + .map(|p| canonicalize(p).map_err(SnapshotFileErrorKind::CanonicalizingPathFailed)) + .collect::>()?; } Ok(self.merge()) }