diff options
author | Neal H. Walfield <neal@pep.foundation> | 2022-12-11 08:55:41 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2022-12-11 23:13:24 +0100 |
commit | 43e8494d3576586c2f372c0f1b492ae5bca22ade (patch) | |
tree | dee401ec79cffabdea0822693c3104a89a2654c3 /openpgp | |
parent | 20c87912844bc324b4f5bbc0783aeaf34f6d373b (diff) |
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.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/parse/hashed_reader.rs | 13 |
1 files changed, 1 insertions, 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<T> { /// Hash for a binary signature. /// @@ -29,16 +30,6 @@ pub(crate) enum HashingMode<T> { Text(T), } -impl<T: Clone> Clone for HashingMode<T> { - fn clone(&self) -> Self { - use self::HashingMode::*; - match self { - Binary(t) => Binary(t.clone()), - Text(t) => Text(t.clone()), - } - } -} - impl<T: std::fmt::Debug> std::fmt::Debug for HashingMode<T> { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { use self::HashingMode::*; @@ -60,8 +51,6 @@ impl<T: PartialEq> PartialEq for HashingMode<T> { } } -impl<T: Eq> Eq for HashingMode<T> { } - impl<T> HashingMode<T> { pub(crate) fn map<U, F: Fn(&T) -> U>(&self, f: F) -> HashingMode<U> { use self::HashingMode::*; |