From 30c2ebdcc2c37cb6bf70a5c49a86101575a049b4 Mon Sep 17 00:00:00 2001 From: kernelkind Date: Mon, 25 Aug 2025 21:12:41 -0400 Subject: [PATCH] use indexmap Signed-off-by: kernelkind --- crates/notedeck/src/nip51_set.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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,