From 43e8494d3576586c2f372c0f1b492ae5bca22ade Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Sun, 11 Dec 2022 08:55:41 +0100 Subject: openpgp: Don't implement traits that can just as well be derived. - The implementation of `Clone` and `Eq` is the same as the corresponding derived version. Use `derive` instead. --- openpgp/src/parse/hashed_reader.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/openpgp/src/parse/hashed_reader.rs b/openpgp/src/parse/hashed_reader.rs index e5d93023..1a02f079 100644 --- a/openpgp/src/parse/hashed_reader.rs +++ b/openpgp/src/parse/hashed_reader.rs @@ -17,6 +17,7 @@ const TRACE : bool = false; /// /// OpenPGP normalizes line endings when signing or verifying text /// signatures. +#[derive(Clone, Eq)] pub(crate) enum HashingMode { /// Hash for a binary signature. /// @@ -29,16 +30,6 @@ pub(crate) enum HashingMode { Text(T), } -impl Clone for HashingMode { - fn clone(&self) -> Self { - use self::HashingMode::*; - match self { - Binary(t) => Binary(t.clone()), - Text(t) => Text(t.clone()), - } - } -} - impl std::fmt::Debug for HashingMode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { use self::HashingMode::*; @@ -60,8 +51,6 @@ impl PartialEq for HashingMode { } } -impl Eq for HashingMode { } - impl HashingMode { pub(crate) fn map U>(&self, f: F) -> HashingMode { use self::HashingMode::*; -- cgit v1.2.3