What changed, and why it matters
This commit only reorganizes where module declarations appear in four Rust source files. It groups private modules together and public modules together, with no changes to what code is exposed, how it behaves, or any security-sensitive logic. There is no security issue here.
No action required. This is a non-functional refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is a pure code-style refactor in lib.rs files across four crates (chacha20_poly1305, p2p, primitives, units). It moves mod declarations for private modules (e.g., consensus, network_ext, opcodes, fee, internal_macros) so they are grouped separately from pub mod declarations. No visibility, API, or implementation changes are introduced. The _export module remains public and is intentionally placed above the private modules. No security signals are present.
Changed components
chacha20_poly1305/src/lib.rsp2p/src/lib.rsprimitives/src/lib.rsunits/src/lib.rsInspect captured patch +9 / −5
diff --git a/chacha20_poly1305/src/lib.rs b/chacha20_poly1305/src/lib.rs
index f8e56505..a8064221 100644
--- a/chacha20_poly1305/src/lib.rs
+++ b/chacha20_poly1305/src/lib.rs
@@ -28,6 +28,7 @@ extern crate test;
#[cfg(bench)]
mod benches;
+
pub mod chacha20;
pub mod poly1305;
diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs
index 8c4a24c9..f2c9414f 100644
--- a/p2p/src/lib.rs
+++ b/p2p/src/lib.rs
@@ -16,9 +16,11 @@
#![allow(clippy::manual_range_contains)] // More readable than clippy's format.
#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")`
+mod consensus;
+mod network_ext;
+
#[cfg(feature = "std")]
pub mod address;
-mod consensus;
#[cfg(feature = "std")]
pub mod message;
pub mod message_blockdata;
@@ -27,7 +29,6 @@ pub mod message_compact_blocks;
pub mod message_filter;
#[cfg(feature = "std")]
pub mod message_network;
-mod network_ext;
extern crate alloc;
#[cfg(feature = "std")]
diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs
index d04ee0ae..b66cb44b 100644
--- a/primitives/src/lib.rs
+++ b/primitives/src/lib.rs
@@ -40,9 +40,10 @@ pub mod _export {
}
}
+mod opcodes;
+
pub mod block;
pub mod merkle_tree;
-mod opcodes;
pub mod pow;
#[cfg(feature = "alloc")]
pub mod script;
diff --git a/units/src/lib.rs b/units/src/lib.rs
index 6c3f9426..528ceee5 100644
--- a/units/src/lib.rs
+++ b/units/src/lib.rs
@@ -34,8 +34,6 @@ extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
-mod fee;
-mod internal_macros;
#[doc(hidden)]
pub mod _export {
@@ -45,6 +43,9 @@ pub mod _export {
}
}
+mod fee;
+mod internal_macros;
+
pub mod amount;
pub mod block;
pub mod fee_rate;
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.