notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 23f35c60bb53f52c5ec4b9044273a200aa6fe503
parent 30c2ebdcc2c37cb6bf70a5c49a86101575a049b4
Author: kernelkind <kernelkind@gmail.com>
Date:   Mon, 25 Aug 2025 21:13:17 -0400

add Nip51SetCache helper methods

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Mcrates/notedeck/src/nip51_set.rs | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/crates/notedeck/src/nip51_set.rs b/crates/notedeck/src/nip51_set.rs @@ -72,6 +72,18 @@ impl Nip51SetCache { pub fn iter(&self) -> impl IntoIterator<Item = &Nip51Set> { self.cached_notes.values() } + + pub fn len(&self) -> usize { + self.cached_notes.len() + } + + pub fn is_empty(&self) -> bool { + self.cached_notes.is_empty() + } + + pub fn at_index(&self, index: usize) -> Option<&Nip51Set> { + self.cached_notes.get_index(index).map(|(_, s)| s) + } } fn add(