Skip to content

Commit

Permalink
PostcardProtocol default implementation is now derived
Browse files Browse the repository at this point in the history
  • Loading branch information
acerone85 committed Oct 21, 2024
1 parent 7160034 commit b2b5b3c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions crates/services/p2p/src/codecs/postcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<str> for PostcardProtocol {
fn as_ref(&self) -> &str {
match self {
Expand Down

0 comments on commit b2b5b3c

Please sign in to comment.