diff --git a/crates/nostr-database/src/tag_indexes.rs b/crates/nostr-database/src/tag_indexes.rs index 106c1d3aa..56acaa810 100644 --- a/crates/nostr-database/src/tag_indexes.rs +++ b/crates/nostr-database/src/tag_indexes.rs @@ -15,11 +15,18 @@ use nostr::{Alphabet, GenericTagValue}; pub const TAG_INDEX_VALUE_SIZE: usize = 8; /// Tag Indexes -#[derive(Debug, Clone, Default, PartialEq, Eq)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] pub struct TagIndexes { inner: HashMap, } +impl TagIndexes { + #[allow(missing_docs)] + pub fn new(map: BTreeMap) -> Self { + Self { inner: map } + } +} + impl Deref for TagIndexes { type Target = HashMap; fn deref(&self) -> &Self::Target { @@ -70,7 +77,7 @@ where } /// Tag Index Values -#[derive(Debug, Clone, Default, PartialEq, Eq)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] pub struct TagIndexValues { inner: HashSet<[u8; TAG_INDEX_VALUE_SIZE]>, }