commit 84026824b266559a791fdde71767e7886c60ebe1 parent 8e92a97a57a66f50bed16a6dc47d9bf14eab1140 Author: kernelkind <kernelkind@gmail.com> Date: Thu, 26 Jun 2025 13:33:35 -0400 enostr: add equivalence between Pubkey & bytes Signed-off-by: kernelkind <kernelkind@gmail.com> Diffstat:
M | crates/enostr/src/pubkey.rs | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/crates/enostr/src/pubkey.rs b/crates/enostr/src/pubkey.rs @@ -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() + } +}