Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix clippy lints #236

Merged
merged 2 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/repofile/keyfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
pub(super) mod constants {
/// Returns the number of bits of the given type.
pub(super) const fn num_bits<T>() -> usize {
std::mem::size_of::<T>() * 8
size_of::<T>() * 8

Check warning on line 17 in crates/core/src/repofile/keyfile.rs

View check run for this annotation

Codecov / codecov/patch

crates/core/src/repofile/keyfile.rs#L17

Added line #L17 was not covered by tests
}
}

Expand Down
10 changes: 6 additions & 4 deletions crates/core/src/repofile/snapshotfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@
}
}

#[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) {}
Expand Down Expand Up @@ -1149,10 +1150,11 @@
*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

Check warning on line 1153 in crates/core/src/repofile/snapshotfile.rs

View check run for this annotation

Codecov / codecov/patch

crates/core/src/repofile/snapshotfile.rs#L1153

Added line #L1153 was not covered by tests
.0
.into_iter()
.map(|p| canonicalize(p).map_err(SnapshotFileErrorKind::CanonicalizingPathFailed))
.collect::<Result<_, _>>()?;

Check warning on line 1157 in crates/core/src/repofile/snapshotfile.rs

View check run for this annotation

Codecov / codecov/patch

crates/core/src/repofile/snapshotfile.rs#L1156-L1157

Added lines #L1156 - L1157 were not covered by tests
}
Ok(self.merge())
}
Expand Down
Loading