What changed, and why it matters
This commit is a routine code cleanup that changes how internal items are imported within the rust-bitcoin library. It switches from importing through intermediate module paths to using crate-level re-exports. There is no functional change, no bug fix, and no security relevance.
No action needed. This is a non-security refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch applies a new import policy in the primitives crate: instead of importing BlockTime from units, TxMerkleNode from crate::merkle_tree, Transaction from crate::transaction, etc., it imports them through crate::{...} re-exports. The diff is purely import statement consolidation and reordering. No logic, types, visibility, or behavior is altered.
Changed components
primitives/src/block.rsprimitives/src/transaction.rsInspect captured patch +3 / −15
diff --git a/primitives/src/block.rs b/primitives/src/block.rs
index 0409c25d..6ca0ad42 100644
--- a/primitives/src/block.rs
+++ b/primitives/src/block.rs
@@ -14,16 +14,12 @@ use core::marker::PhantomData;
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use hashes::{sha256d, HashEngine as _};
-use units::BlockTime;
-use crate::merkle_tree::TxMerkleNode;
-#[cfg(feature = "alloc")]
-use crate::merkle_tree::WitnessMerkleNode;
-use crate::pow::CompactTarget;
#[cfg(feature = "alloc")]
use crate::prelude::Vec;
#[cfg(feature = "alloc")]
-use crate::transaction::Transaction;
+use crate::{Transaction, WitnessMerkleNode};
+use crate::{BlockTime, CompactTarget, TxMerkleNode};
#[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)]
diff --git a/primitives/src/transaction.rs b/primitives/src/transaction.rs
index 2651f770..577f3722 100644
--- a/primitives/src/transaction.rs
+++ b/primitives/src/transaction.rs
@@ -24,21 +24,13 @@ use hashes::sha256d;
use internals::compact_size;
#[cfg(feature = "hex")]
use internals::write_err;
-#[cfg(feature = "alloc")]
-use units::locktime::absolute;
#[cfg(feature = "hex")]
use units::parse_int;
-#[cfg(feature = "alloc")]
-use units::sequence::Sequence;
-#[cfg(feature = "alloc")]
-use units::{Amount, Weight};
#[cfg(feature = "alloc")]
use crate::prelude::Vec;
#[cfg(feature = "alloc")]
-use crate::script::{ScriptPubKeyBuf, ScriptSigBuf};
-#[cfg(feature = "alloc")]
-use crate::witness::Witness;
+use crate::{absolute, Amount, ScriptPubKeyBuf, ScriptSigBuf, Sequence, Weight, Witness};
/// Bitcoin transaction.
///
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.