enostr: add equivalence between Pubkey & bytes
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -166,3 +166,9 @@ impl<'de> Deserialize<'de> for Pubkey {
|
|||||||
Pubkey::from_hex(&s).map_err(serde::de::Error::custom)
|
Pubkey::from_hex(&s).map_err(serde::de::Error::custom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl hashbrown::Equivalent<Pubkey> for &[u8; 32] {
|
||||||
|
fn equivalent(&self, key: &Pubkey) -> bool {
|
||||||
|
self.as_slice() == key.bytes()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user