Skip to content

Commit

Permalink
fix: implement IntoIterator for &PathTree<T>
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Bodmer <[email protected]>
  • Loading branch information
mbodmer committed Jun 6, 2024
1 parent 8e0e0e2 commit a894c9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ extern crate alloc;

use alloc::{
string::{String, ToString},
vec::{IntoIter, Vec},
vec::Vec,
};
use core::{slice::Iter, str::from_utf8};
use smallvec::SmallVec;
Expand Down Expand Up @@ -264,12 +264,12 @@ impl<T> PathTree<T> {
}
}

impl<T> IntoIterator for PathTree<T> {
type Item = (T, Vec<Piece>);
type IntoIter = IntoIter<(T, Vec<Piece>)>;
impl<'a, T> IntoIterator for &'a PathTree<T> {
type Item = &'a (T, Vec<Piece>);
type IntoIter = Iter<'a, (T, Vec<Piece>)>;

fn into_iter(self) -> Self::IntoIter {
self.routes.into_iter()
self.iter()
}
}

Expand Down

0 comments on commit a894c9a

Please sign in to comment.