diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-07-28 11:16:48 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-07-28 14:51:31 +0200 |
commit | 52d3a63f1f0c0ad130f9a8351ef591aed28004ca (patch) | |
tree | 096772f2fb81ce8cf7f244d929915fa744be1b02 /openpgp | |
parent | f64940feff7fb8020c5cbd6d69c9eb28d61a8898 (diff) |
openpgp: Derive Eq, Hash for Features.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/types/features.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/openpgp/src/types/features.rs b/openpgp/src/types/features.rs index ca82f797..f1021d2f 100644 --- a/openpgp/src/types/features.rs +++ b/openpgp/src/types/features.rs @@ -1,5 +1,4 @@ use std::fmt; -use std::hash::{Hash, Hasher}; #[cfg(any(test, feature = "quickcheck"))] use quickcheck::{Arbitrary, Gen}; @@ -52,8 +51,8 @@ use quickcheck::{Arbitrary, Gen}; /// } /// # Ok(()) } /// ``` -#[derive(Clone, PartialEq)] -pub struct Features{ +#[derive(Clone, PartialEq, Eq, Hash)] +pub struct Features { raw: Vec<u8>, } @@ -111,14 +110,6 @@ impl fmt::Debug for Features { } } -impl Eq for Features {} - -impl Hash for Features { - fn hash<H: Hasher>(&self, state: &mut H) { - self.raw.hash(state); - } -} - impl Features { /// Creates a new instance from `bytes`. /// |