diff --git a/crates/notedeck/src/nip51_set.rs b/crates/notedeck/src/nip51_set.rs index e5f05b0e..50603071 100644 --- a/crates/notedeck/src/nip51_set.rs +++ b/crates/notedeck/src/nip51_set.rs @@ -1,6 +1,5 @@ -use std::collections::HashMap; - use enostr::{Pubkey, RelayPool}; +use indexmap::IndexMap; use nostrdb::{Filter, Ndb, Note, Transaction}; use uuid::Uuid; @@ -10,7 +9,7 @@ use crate::{UnifiedSubscription, UnknownIds}; #[derive(Debug)] pub struct Nip51SetCache { pub sub: UnifiedSubscription, - cached_notes: HashMap, + cached_notes: IndexMap, } type PackId = String; @@ -24,7 +23,7 @@ impl Nip51SetCache { nip51_set_filter: Vec, ) -> Option { let subid = Uuid::new_v4().to_string(); - let mut cached_notes = HashMap::default(); + let mut cached_notes = IndexMap::default(); let notes: Option> = if let Ok(results) = ndb.query(txn, &nip51_set_filter, 500) { Some(results.into_iter().map(|r| r.note).collect()) @@ -77,7 +76,7 @@ impl Nip51SetCache { fn add( notes: Vec, - cache: &mut HashMap, + cache: &mut IndexMap, ndb: &Ndb, txn: &Transaction, unknown_ids: &mut UnknownIds,