What changed, and why it matters
This commit only turns on a code-style lint (clippy::use_self) and makes two tiny style changes so the code passes the new lint. It does not change behavior, fix a bug, or address any security issue.
No security action needed; this is a routine code-quality/linting change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds use_self = "warn" in internals/Cargo.toml and replaces two explicit type names (ArrayVec<T, CAP> and Storage) with Self in trait implementations. These are purely idiomatic/style changes with no functional or security effect.
Changed components
internals/Cargo.tomlinternals/src/array_vec.rsinternals/src/error/input_string.rsInspect captured patch +5 / −2
diff --git a/internals/Cargo.toml b/internals/Cargo.toml
index deffa841..2c41b3c3 100644
--- a/internals/Cargo.toml
+++ b/internals/Cargo.toml
@@ -36,3 +36,6 @@ rustdoc-args = ["--cfg", "docsrs"]
[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(kani)'] }
+
+[lints.clippy]
+use_self = "warn"
diff --git a/internals/src/array_vec.rs b/internals/src/array_vec.rs
index 9e402b02..40157a27 100644
--- a/internals/src/array_vec.rs
+++ b/internals/src/array_vec.rs
@@ -140,7 +140,7 @@ impl<T: Copy + PartialEq, const CAP: usize, const LEN: usize> PartialEq<ArrayVec
}
impl<T: Copy + Ord, const CAP: usize> Ord for ArrayVec<T, CAP> {
- fn cmp(&self, other: &ArrayVec<T, CAP>) -> core::cmp::Ordering { (**self).cmp(&**other) }
+ fn cmp(&self, other: &Self) -> core::cmp::Ordering { (**self).cmp(&**other) }
}
impl<T: Copy + PartialOrd, const CAP1: usize, const CAP2: usize> PartialOrd<ArrayVec<T, CAP2>>
diff --git a/internals/src/error/input_string.rs b/internals/src/error/input_string.rs
index b544c734..d5e71aa3 100644
--- a/internals/src/error/input_string.rs
+++ b/internals/src/error/input_string.rs
@@ -122,7 +122,7 @@ mod storage {
}
impl From<&str> for Storage {
- fn from(_value: &str) -> Self { Storage }
+ fn from(_value: &str) -> Self { Self }
}
pub(super) fn cannot_parse<W>(_: &Storage, what: &W, f: &mut fmt::Formatter) -> fmt::Result
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.