What changed, and why it matters
This commit is a routine internal cleanup in the rust-bitcoin library's base58 module. It removes an unused 'push' method from a private helper trait called Buffer, because the code now uses a fallible 'try_push' method instead. There is no security-relevant change: no behavior is altered, no bug is fixed, and no vulnerability is introduced or removed.
No action required. This is a non-security refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the infallible push method and its implementations from the private Buffer trait in base58/src/lib.rs. The callers had already been switched to try_push, so push was dead code. This is a pure refactoring with no functional or security impact.
Changed components
base58/src/lib.rsprivate Buffer traitInspect captured patch +0 / −5
diff --git a/base58/src/lib.rs b/base58/src/lib.rs
index 44accf50..5bcfea24 100644
--- a/base58/src/lib.rs
+++ b/base58/src/lib.rs
@@ -221,7 +221,6 @@ const fn encoded_check_reserve_len(unencoded_len: usize) -> usize {
trait Buffer: Sized {
type Err: fmt::Debug;
- fn push(&mut self, val: u8);
fn try_push(&mut self, val: u8) -> Result<(), Self::Err>;
fn slice(&self) -> &[u8];
fn slice_mut(&mut self) -> &mut [u8];
@@ -231,8 +230,6 @@ trait Buffer: Sized {
impl Buffer for Vec<u8> {
type Err = Infallible;
- fn push(&mut self, val: u8) { Self::push(self, val) }
-
fn try_push(&mut self, val: u8) -> Result<(), Self::Err> {
self.push(val);
Ok(())
@@ -246,8 +243,6 @@ impl Buffer for Vec<u8> {
impl<const N: usize> Buffer for ArrayVec<u8, N> {
type Err = internals::array_vec::error::Error;
- fn push(&mut self, val: u8) { Self::push(self, val) }
-
fn try_push(&mut self, val: u8) -> Result<(), Self::Err> { self.try_push(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.