consensus_encoding: remove redundant trait bounds
What changed, and why it matters
This is a minor code cleanup in a Rust Bitcoin library. It removes unnecessary requirements (trait bounds) from an error-handling implementation. The change does not affect security, runtime behavior, or how the library processes Bitcoin data.
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 commit simplifies the std::error::Error implementation for ReadError<D> by removing redundant trait bounds. In Rust, std::error::Error already requires Debug + Display, so listing those bounds explicitly was unnecessary. The resulting behavior is identical; this is a pure refactoring with no functional change.
Changed components
consensus_encoding/src/decode/mod.rsInspect captured patch +1 / −1
diff --git a/consensus_encoding/src/decode/mod.rs b/consensus_encoding/src/decode/mod.rs
index e1d3e705..d3407b2d 100644
--- a/consensus_encoding/src/decode/mod.rs
+++ b/consensus_encoding/src/decode/mod.rs
@@ -240,7 +240,7 @@ impl<D: core::fmt::Display> core::fmt::Display for ReadError<D> {
#[cfg(feature = "std")]
impl<D> std::error::Error for ReadError<D>
where
- D: core::fmt::Debug + core::fmt::Display + std::error::Error + 'static,
+ D: std::error::Error + 'static,
{
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
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.