Skip to content

Commit 2058364

Browse files
aawsomenardoor
authored andcommitted
chore: fix clippy lints (#236)
1 parent 427f958 commit 2058364

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

Cargo.toml

+8-8
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ codegen-units = 1
6969
[workspace.lints.rust]
7070
unsafe_code = "forbid"
7171
missing_docs = "warn"
72-
rust_2018_idioms = "warn"
72+
rust_2018_idioms = { level = "warn", priority = -1 }
7373
trivial_casts = "warn"
7474
unused_lifetimes = "warn"
7575
unused_qualifications = "warn"
@@ -88,7 +88,7 @@ unused_results = "warn"
8888
unused_extern_crates = "warn"
8989
unused_import_braces = "warn"
9090
unconditional_recursion = "warn"
91-
unused = "warn"
91+
unused = { level = "warn", priority = -1 }
9292
unused_allocation = "warn"
9393
unused_comparisons = "warn"
9494
unused_parens = "warn"
@@ -97,15 +97,15 @@ unreachable_pub = "allow"
9797

9898
[workspace.lints.clippy]
9999
redundant_pub_crate = "allow"
100-
pedantic = "warn"
101-
nursery = "warn"
100+
pedantic = { level = "warn", priority = -1 }
101+
nursery = { level = "warn", priority = -1 }
102102
# expect_used = "warn" # TODO!
103103
# unwrap_used = "warn" # TODO!
104104
enum_glob_use = "warn"
105-
correctness = "warn"
106-
suspicious = "warn"
107-
complexity = "warn"
108-
perf = "warn"
105+
correctness = { level = "warn", priority = -1 }
106+
suspicious = { level = "warn", priority = -1 }
107+
complexity = { level = "warn", priority = -1 }
108+
perf = { level = "warn", priority = -1 }
109109
cast_lossless = "warn"
110110
default_trait_access = "warn"
111111
doc_markdown = "warn"

crates/core/src/repofile/keyfile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
pub(super) mod constants {
1515
/// Returns the number of bits of the given type.
1616
pub(super) const fn num_bits<T>() -> usize {
17-
std::mem::size_of::<T>() * 8
17+
size_of::<T>() * 8
1818
}
1919
}
2020

crates/core/src/repofile/snapshotfile.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ impl StringList {
10561056
}
10571057
}
10581058

1059+
#[allow(clippy::needless_pass_by_ref_mut)]
10591060
#[deprecated(note = "StringLists are now automatically sorted")]
10601061
/// Sort the Strings in the [`StringList`]
10611062
pub fn sort(&mut self) {}
@@ -1149,10 +1150,11 @@ impl PathList {
11491150
*path = sanitize_dot(path)?;
11501151
}
11511152
if self.0.iter().any(|p| p.is_absolute()) {
1152-
for path in &mut self.0 {
1153-
*path =
1154-
canonicalize(&path).map_err(SnapshotFileErrorKind::CanonicalizingPathFailed)?;
1155-
}
1153+
self.0 = self
1154+
.0
1155+
.into_iter()
1156+
.map(|p| canonicalize(p).map_err(SnapshotFileErrorKind::CanonicalizingPathFailed))
1157+
.collect::<Result<_, _>>()?;
11561158
}
11571159
Ok(self.merge())
11581160
}

0 commit comments

Comments
 (0)