What changed, and why it matters
This commit is a minor code-style cleanup in the base58 subcrate. It turns on a Clippy lint that encourages using 'Self' instead of the type name when calling functions inside an implementation block, and updates two function calls to match. There is no change to behavior, no bug fix, and no security relevance.
No security action needed. Treat as normal maintenance/style commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds clippy::use_self = ‘warn’ to base58/Cargo.toml and replaces Vec::push and ArrayVec::push with Self::push in trait implementations for the Buffer trait. This is purely idiomatic/style refactoring; the compiled code is equivalent and no security property is altered.
Changed components
base58/Cargo.tomlbase58/src/lib.rsInspect captured patch +5 / −2
diff --git a/base58/Cargo.toml b/base58/Cargo.toml
index 5dd0e783..731bab4f 100644
--- a/base58/Cargo.toml
+++ b/base58/Cargo.toml
@@ -30,3 +30,6 @@ rustdoc-args = ["--cfg", "docsrs"]
[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(fuzzing)', 'cfg(kani)' ] }
+
+[lints.clippy]
+use_self = "warn"
diff --git a/base58/src/lib.rs b/base58/src/lib.rs
index d474dd64..85debd87 100644
--- a/base58/src/lib.rs
+++ b/base58/src/lib.rs
@@ -193,7 +193,7 @@ trait Buffer: Sized {
}
impl Buffer for Vec<u8> {
- fn push(&mut self, val: u8) { Vec::push(self, val) }
+ fn push(&mut self, val: u8) { Self::push(self, val) }
fn slice(&self) -> &[u8] { self }
@@ -201,7 +201,7 @@ impl Buffer for Vec<u8> {
}
impl<const N: usize> Buffer for ArrayVec<u8, N> {
- fn push(&mut self, val: u8) { ArrayVec::push(self, val) }
+ fn push(&mut self, val: u8) { Self::push(self, val) }
fn slice(&self) -> &[u8] { self.as_slice() }
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.