enostr: add equivalence between Pubkey & bytes

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-06-26 13:33:35 -04:00
parent 8e92a97a57
commit 84026824b2

View File

@@ -166,3 +166,9 @@ impl<'de> Deserialize<'de> for Pubkey {
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()
}
}