summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet/marker.rs
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-12-03 12:18:15 +0100
committerNora Widdecke <nora@sequoia-pgp.org>2021-12-03 15:07:59 +0100
commit34bf61a959efff8b1876c24bc5e7f058ec45fefe (patch)
tree406a7159fbcda73fe80bd664925fadf458b7d6fe /openpgp/src/packet/marker.rs
parent98491a207c6401b158103ae95e9abb85157025cd (diff)
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
Diffstat (limited to 'openpgp/src/packet/marker.rs')
-rw-r--r--openpgp/src/packet/marker.rs10
1 files changed, 1 insertions, 9 deletions
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<Marker> for Packet {
fn from(p: Marker) -> Self {
Packet::Marker(p)