Make consensus errors pub and no_inline
What changed, and why it matters
This commit is a routine Rust code organization change. It makes an internal error module publicly visible and adjusts how error types are re-exported so they appear in documentation as coming from their submodule rather than being shown inline. There is no change to how errors are handled, no new functionality, and no security fix or vulnerability.
No security action needed. Review as normal API refactor if desired.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes bitcoin/src/consensus/mod.rs: the error submodule is changed from mod error to pub mod error, and the public re-exports of Error, FromHexError, DecodeError, ParseError, and DeserializeError are moved from a #[doc(inline)] block to a separate #[doc(no_inline)] block. This is part of a project-wide refactor to move error types into error submodules and control rustdoc presentation. The actual error definitions and behavior are unchanged.
Changed components
bitcoin/src/consensus/mod.rsInspect captured patch +3 / −2
diff --git a/bitcoin/src/consensus/mod.rs b/bitcoin/src/consensus/mod.rs
index 10a28c85..49ffe4ef 100644
--- a/bitcoin/src/consensus/mod.rs
+++ b/bitcoin/src/consensus/mod.rs
@@ -6,7 +6,7 @@
//! conform to Bitcoin consensus.
pub mod encode;
-mod error;
+pub mod error;
#[cfg(feature = "serde")]
pub mod serde;
#[cfg(kani)]
@@ -22,9 +22,10 @@ use crate::consensus;
#[doc(inline)]
pub use self::{
encode::{deserialize, deserialize_partial, serialize, Decodable, Encodable, ReadExt, WriteExt},
- error::{Error, FromHexError, DecodeError, ParseError, DeserializeError},
};
pub(crate) use self::error::parse_failed_error;
+#[doc(no_inline)]
+pub use self::error::{DecodeError, DeserializeError, Error, FromHexError, ParseError};
struct IterReader<E: fmt::Debug, I: Iterator<Item = Result<u8, E>>> {
iterator: core::iter::Fuse<I>,
Why this scored 16/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.