Implement an ersatz hash() for RSAIdentity
For whatever reason, something I had didn't like me implementing a custom PartialEq but deriving Hash
This commit is contained in:
parent
4b75c51882
commit
790d6becf2
|
@ -19,7 +19,7 @@ pub const RSA_ID_LEN: usize = 20;
|
|||
|
||||
/// An identifier for a Tor relay, based on its legacy RSA
|
||||
/// identity key. These are used all over the Tor protocol.
|
||||
#[derive(Clone, Zeroize, Debug, Hash)]
|
||||
#[derive(Clone, Zeroize, Debug)]
|
||||
pub struct RSAIdentity {
|
||||
id: [u8; RSA_ID_LEN],
|
||||
}
|
||||
|
@ -30,6 +30,12 @@ impl PartialEq<RSAIdentity> for RSAIdentity {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::hash::Hash for RSAIdentity {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
self.id.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for RSAIdentity {}
|
||||
|
||||
impl RSAIdentity {
|
||||
|
|
Loading…
Reference in New Issue