commit 6da10c4fafec2e7df770d4267d4ec51d4de9ab42
parent cc5a888b89a3c772ee2cc849652d3c01515e8b78
Author: kernelkind <kernelkind@gmail.com>
Date: Mon, 16 Jun 2025 17:16:02 -0400
add `NoteId` hashbrown `Equivalent` impl
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -1554,6 +1554,7 @@ version = "0.3.0"
dependencies = [
"bech32",
"ewebsock",
+ "hashbrown",
"hex",
"mio",
"nostr 0.37.0",
diff --git a/crates/enostr/Cargo.toml b/crates/enostr/Cargo.toml
@@ -20,3 +20,4 @@ url = { workspace = true }
mio = { workspace = true }
tokio = { workspace = true }
tokenator = { workspace = true }
+hashbrown = { workspace = true }
+\ No newline at end of file
diff --git a/crates/enostr/src/note.rs b/crates/enostr/src/note.rs
@@ -143,3 +143,9 @@ impl<'de> Deserialize<'de> for NoteId {
NoteId::from_hex(&s).map_err(serde::de::Error::custom)
}
}
+
+impl hashbrown::Equivalent<NoteId> for &[u8; 32] {
+ fn equivalent(&self, key: &NoteId) -> bool {
+ self.as_slice() == key.bytes()
+ }
+}