Skip to content

Commit 8e0e0e2

Browse files
committed
feat: implement IntoIterator trait instead of forwarding from vec
Signed-off-by: Marc Bodmer <[email protected]>
1 parent 176e2a3 commit 8e0e0e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,13 @@ impl<T> PathTree<T> {
262262
pub fn iter(&self) -> Iter<'_, (T, Vec<Piece>)> {
263263
self.routes.iter()
264264
}
265+
}
266+
267+
impl<T> IntoIterator for PathTree<T> {
268+
type Item = (T, Vec<Piece>);
269+
type IntoIter = IntoIter<(T, Vec<Piece>)>;
265270

266-
pub fn into_iter(self) -> IntoIter<(T, Vec<Piece>)> {
271+
fn into_iter(self) -> Self::IntoIter {
267272
self.routes.into_iter()
268273
}
269274
}

0 commit comments

Comments
 (0)