From 34bf61a959efff8b1876c24bc5e7f058ec45fefe Mon Sep 17 00:00:00 2001 From: Nora Widdecke Date: Fri, 3 Dec 2021 12:18:15 +0100 Subject: openpgp: Derive Default. - Replace manual implementations of Default where the derive(Default) is identical. - Suggested by clippy, https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impl --- openpgp/src/packet/marker.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'openpgp/src/packet/marker.rs') diff --git a/openpgp/src/packet/marker.rs b/openpgp/src/packet/marker.rs index f8b84842..edeb03ae 100644 --- a/openpgp/src/packet/marker.rs +++ b/openpgp/src/packet/marker.rs @@ -11,7 +11,7 @@ use crate::Packet; /// [Section 5.8 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.8 // IMPORTANT: If you add fields to this struct, you need to explicitly // IMPORTANT: implement PartialEq, Eq, and Hash. -#[derive(Clone, Debug, PartialEq, Eq, Hash)] +#[derive(Default, Clone, Debug, PartialEq, Eq, Hash)] pub struct Marker { /// CTB packet header fields. pub(crate) common: packet::Common, @@ -22,14 +22,6 @@ impl Marker { pub(crate) const BODY: &'static [u8] = &[0x50, 0x47, 0x50]; } -impl Default for Marker { - fn default() -> Self { - Self { - common: Default::default(), - } - } -} - impl From for Packet { fn from(p: Marker) -> Self { Packet::Marker(p) -- cgit v1.2.3