What changed, and why it matters
This commit is a minor code cleanup. It imports two common Rust traits (`Borrow` and `Deref`) directly at the top of two source files, instead of referring to them with their full `core::...` module path inside the code. There is no functional change, no bug fix, and no security relevance.
No action required. This is a non-security refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit changes bitcoin/src/crypto/ecdsa.rs and bitcoin/src/crypto/taproot.rs to add use core::borrow::Borrow; and use core::ops::Deref; imports, then replaces fully-qualified trait names (core::borrow::Borrow, core::ops::Deref, ops::Deref) with the unqualified names. This is purely a stylistic/uniformity refactor; the generated code is identical.
Changed components
bitcoin/src/crypto/ecdsa.rsbitcoin/src/crypto/taproot.rsInspect captured patch +6 / −3
diff --git a/bitcoin/src/crypto/ecdsa.rs b/bitcoin/src/crypto/ecdsa.rs
index 8e975626..3f87d425 100644
--- a/bitcoin/src/crypto/ecdsa.rs
+++ b/bitcoin/src/crypto/ecdsa.rs
@@ -4,7 +4,9 @@
//!
//! This module provides ECDSA signatures used by Bitcoin that can be roundtrip (de)serialized.
+use core::borrow::Borrow;
use core::convert::Infallible;
+use core::ops::Deref;
use core::str::FromStr;
use core::{fmt, iter};
@@ -194,12 +196,12 @@ impl AsRef<[u8]> for SerializedSignature {
fn as_ref(&self) -> &[u8] { &self.data[..self.len] }
}
-impl core::borrow::Borrow<[u8]> for SerializedSignature {
+impl Borrow<[u8]> for SerializedSignature {
#[inline]
fn borrow(&self) -> &[u8] { &self.data[..self.len] }
}
-impl core::ops::Deref for SerializedSignature {
+impl Deref for SerializedSignature {
type Target = [u8];
#[inline]
diff --git a/bitcoin/src/crypto/taproot.rs b/bitcoin/src/crypto/taproot.rs
index 1ce868e7..9a5a2f34 100644
--- a/bitcoin/src/crypto/taproot.rs
+++ b/bitcoin/src/crypto/taproot.rs
@@ -6,6 +6,7 @@
use core::borrow::Borrow;
use core::convert::Infallible;
+use core::ops::Deref;
use core::{fmt, ops};
#[cfg(feature = "arbitrary")]
@@ -217,7 +218,7 @@ impl Borrow<[u8]> for SerializedSignature {
fn borrow(&self) -> &[u8] { &self.data[..self.len] }
}
-impl ops::Deref for SerializedSignature {
+impl Deref for SerializedSignature {
type Target = [u8];
#[inline]
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.