From b2b5b3cb6040b732eec70f0f3d5a24e77bb1110b Mon Sep 17 00:00:00 2001 From: acerone85 Date: Mon, 21 Oct 2024 12:28:20 +0100 Subject: [PATCH] PostcardProtocol default implementation is now derived --- crates/services/p2p/src/codecs/postcard.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/services/p2p/src/codecs/postcard.rs b/crates/services/p2p/src/codecs/postcard.rs index ae83424873..b2701c0be6 100644 --- a/crates/services/p2p/src/codecs/postcard.rs +++ b/crates/services/p2p/src/codecs/postcard.rs @@ -188,18 +188,13 @@ impl NetworkCodec for PostcardCodec { } } -#[derive(Debug, Clone, EnumIter)] +#[derive(Debug, Default, Clone, EnumIter)] pub enum PostcardProtocol { + #[default] V1, V2, } -impl Default for PostcardProtocol { - fn default() -> Self { - PostcardProtocol::V1 - } -} - impl AsRef for PostcardProtocol { fn as_ref(&self) -> &str { match self {