What changed, and why it matters
This commit simply reorders existing code in a Rust source file. It moves two blocks of code (implementations of Deref and DerefMut for SerializedSignature) to a different location within the same file so the order matches another module. No code behavior is changed, no bugs are fixed, and no security issue is introduced.
No action needed; this is a non-functional refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure code move: the Deref and DerefMut implementations for SerializedSignature are relocated after the AsRef
Changed components
bitcoin/src/crypto/ecdsa.rsInspect captured patch +12 / −12
diff --git a/bitcoin/src/crypto/ecdsa.rs b/bitcoin/src/crypto/ecdsa.rs
index 82202ba7..c87a7321 100644
--- a/bitcoin/src/crypto/ecdsa.rs
+++ b/bitcoin/src/crypto/ecdsa.rs
@@ -200,18 +200,6 @@ impl AsMut<[u8]> for SerializedSignature {
fn as_mut(&mut self) -> &mut [u8] { self }
}
-impl core::ops::Deref for SerializedSignature {
- type Target = [u8];
-
- #[inline]
- fn deref(&self) -> &Self::Target { &self.data[..self.len] }
-}
-
-impl core::ops::DerefMut for SerializedSignature {
- #[inline]
- fn deref_mut(&mut self) -> &mut Self::Target { &mut self.data[..self.len] }
-}
-
impl AsRef<PushBytes> for SerializedSignature {
#[inline]
fn as_ref(&self) -> &PushBytes { &<&PushBytes>::from(&self.data)[..self.len()] }
@@ -227,6 +215,18 @@ impl core::borrow::BorrowMut<[u8]> for SerializedSignature {
fn borrow_mut(&mut self) -> &mut [u8] { self }
}
+impl core::ops::Deref for SerializedSignature {
+ type Target = [u8];
+
+ #[inline]
+ fn deref(&self) -> &Self::Target { &self.data[..self.len] }
+}
+
+impl core::ops::DerefMut for SerializedSignature {
+ #[inline]
+ fn deref_mut(&mut self) -> &mut Self::Target { &mut self.data[..self.len] }
+}
+
impl<'a> IntoIterator for &'a SerializedSignature {
type IntoIter = core::slice::Iter<'a, u8>;
type Item = &'a u8;
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.