From 397a4b9382252cd44c2306c03f6d7300c4a5511b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 31 Oct 2024 15:47:43 +1100 Subject: [PATCH 1/2] Remove wildcard in push_bytes module Remove the wildcard even though it is only re-exporting things from module code within the file. --- bitcoin/src/blockdata/script/push_bytes.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/blockdata/script/push_bytes.rs b/bitcoin/src/blockdata/script/push_bytes.rs index 654342b14..fc8cf163d 100644 --- a/bitcoin/src/blockdata/script/push_bytes.rs +++ b/bitcoin/src/blockdata/script/push_bytes.rs @@ -9,7 +9,8 @@ use crate::script; #[rustfmt::skip] // Keep public re-exports separate. #[doc(inline)] -pub use self::primitive::*; +// This is not the usual re-export, `primitive` here is an code audit thing. +pub use self::primitive::{PushBytes, PushBytesBuf}; /// This module only contains required operations so that outside functions wouldn't accidentally /// break invariants. Therefore auditing this module should be sufficient. @@ -421,7 +422,8 @@ impl PushBytesErrorReport for core::convert::Infallible { fn input_len(&self) -> usize { match *self {} } } -pub use error::*; +#[doc(inline)] +pub use error::PushBytesError; #[cfg(any(target_pointer_width = "16", target_pointer_width = "32"))] mod error { From 0bf1910980a13005496244ec4d4adf0553afbc73 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 31 Oct 2024 15:50:22 +1100 Subject: [PATCH 2/2] Remove wildcard from script self re-exports In the `script` module remove the wildcards and re-export stuff from `self` explicitly in both `primitives` and `bitcoin`. Internal change only, everything is re-exported. --- bitcoin/src/blockdata/script/mod.rs | 6 +++--- primitives/src/script/mod.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bitcoin/src/blockdata/script/mod.rs b/bitcoin/src/blockdata/script/mod.rs index c79e6d856..d0e269975 100644 --- a/bitcoin/src/blockdata/script/mod.rs +++ b/bitcoin/src/blockdata/script/mod.rs @@ -75,10 +75,10 @@ use crate::OutPoint; #[doc(inline)] pub use self::{ borrowed::ScriptExt, - builder::*, - instruction::*, + builder::Builder, + instruction::{Instruction, Instructions, InstructionIndices}, owned::ScriptBufExt, - push_bytes::*, + push_bytes::{PushBytes, PushBytesBuf, PushBytesError, PushBytesErrorReport}, }; #[doc(inline)] pub use primitives::script::*; diff --git a/primitives/src/script/mod.rs b/primitives/src/script/mod.rs index 9635d4e3f..5ddec69ed 100644 --- a/primitives/src/script/mod.rs +++ b/primitives/src/script/mod.rs @@ -25,8 +25,8 @@ use crate::prelude::{Borrow, BorrowMut, Box, Cow, ToOwned, Vec}; #[rustfmt::skip] // Keep public re-exports separate. #[doc(inline)] pub use self::{ - borrowed::*, - owned::*, + borrowed::Script, + owned::ScriptBuf, }; // We keep all the `Script` and `ScriptBuf` impls together since its easier to see side-by-side.