From 2f91092d773e1618314b62c9e3eae17c08e1f5ad Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 8 Jan 2025 10:34:47 +1100 Subject: [PATCH] Derive Clone on consensus errors All error types in the repo use either [0]: - `#[derive(Debug, Clone, PartialEq, Eq)]`` - `#[derive(Debug)]` However the `consensus` error types do not have `Clone` derived. Derive `Clone` on `consensus::ParseError` and `consensus::Error`. [0] Excluding `PushBytesError`, fixed in #3879 --- bitcoin/src/consensus/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/consensus/error.rs b/bitcoin/src/consensus/error.rs index 500e9ecef..d10f033e3 100644 --- a/bitcoin/src/consensus/error.rs +++ b/bitcoin/src/consensus/error.rs @@ -13,7 +13,7 @@ use internals::write_err; use super::IterReader; /// Error deserializing from a slice. -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] #[non_exhaustive] pub enum DeserializeError { /// Error parsing encoded object. @@ -149,7 +149,7 @@ impl From for Error { } /// Encoding is invalid. -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] #[non_exhaustive] pub enum ParseError { /// Missing data (early end of file or slice too short).