From e0995fb47ca3b8e42fed8dee6d9d6ec1fc206bb4 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 19 Dec 2024 17:19:42 +0100 Subject: [PATCH] chore: manual default impl --- crates/consensus/src/block/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/consensus/src/block/mod.rs b/crates/consensus/src/block/mod.rs index 898eda39cf6..dbe99713680 100644 --- a/crates/consensus/src/block/mod.rs +++ b/crates/consensus/src/block/mod.rs @@ -19,7 +19,7 @@ use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable}; /// Taken from [reth-primitives](https://github.com/paradigmxyz/reth) /// /// See p2p block encoding reference: -#[derive(Debug, Clone, PartialEq, Eq, Default)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Block { /// Block header. pub header: H, @@ -34,6 +34,15 @@ impl Block { } } +impl Default for Block +where + H: Default, +{ + fn default() -> Self { + Self { header: Default::default(), body: Default::default() } + } +} + #[cfg(any(test, feature = "arbitrary"))] impl<'a, T> arbitrary::Arbitrary<'a> for Block where