From 28f48b81598702b491fcf6543f3ea4dcb64b5594 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 16 Jan 2023 10:49:06 +1000 Subject: [PATCH] Derive a Default impl --- .../types/get_block_template/proposal.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template/proposal.rs b/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template/proposal.rs index c3afe443654..97b4bf64bb7 100644 --- a/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template/proposal.rs +++ b/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template/proposal.rs @@ -73,10 +73,11 @@ impl From for Response { } /// The source of the time in the block proposal header. -#[derive(Copy, Clone, Debug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)] pub enum TimeSource { /// The `curtime` field in the template. /// This is the default time source. + #[default] CurTime, /// The `mintime` field in the template. @@ -119,12 +120,6 @@ impl TimeSource { } } -impl Default for TimeSource { - fn default() -> Self { - TimeSource::CurTime - } -} - impl FromStr for TimeSource { type Err = ParseIntError;