Skip to content

Commit

Permalink
fix double ended iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed Jun 17, 2022
1 parent e032415 commit f7a3d36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/kbucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ where
}

/// Returns an iterator over all the entries in the routing table.
pub fn iter(&mut self) -> impl Iterator<Item = EntryRefView<'_, TNodeId, TVal>> {
pub fn iter(&mut self) -> impl DoubleEndedIterator<Item = EntryRefView<'_, TNodeId, TVal>> {
let applied_pending = &mut self.applied_pending;
self.buckets.iter_mut().flat_map(move |table| {
if let Some(applied) = table.apply_pending() {
Expand Down
2 changes: 1 addition & 1 deletion src/kbucket/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ where
}

/// Returns an iterator over the nodes in the bucket, together with their status.
pub fn iter(&self) -> impl Iterator<Item = &Node<TNodeId, TVal>> {
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &Node<TNodeId, TVal>> {
self.nodes.iter()
}

Expand Down

0 comments on commit f7a3d36

Please sign in to comment.