Skip to content

Commit

Permalink
chore(trie): PrefixSet::iter (#8343)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored May 22, 2024
1 parent cd039d3 commit c34b31e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/trie/src/prefix_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ impl PrefixSet {
false
}

/// Returns an iterator over reference to _all_ nibbles regardless of cursor position.
pub fn iter(&self) -> core::slice::Iter<'_, Nibbles> {
self.keys.iter()
}

/// Returns the number of elements in the set.
pub fn len(&self) -> usize {
self.keys.len()
Expand Down

0 comments on commit c34b31e

Please sign in to comment.