Skip to content

Commit 176e2a3

Browse files
committed
feat: also add into_iter()
clippy requests an implementation of into_iter() when implementing iter() Signed-off-by: Marc Bodmer <[email protected]>
1 parent 3cff541 commit 176e2a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ extern crate alloc;
140140

141141
use alloc::{
142142
string::{String, ToString},
143-
vec::Vec,
143+
vec::{IntoIter, Vec},
144144
};
145145
use core::{slice::Iter, str::from_utf8};
146146
use smallvec::SmallVec;
@@ -262,6 +262,10 @@ impl<T> PathTree<T> {
262262
pub fn iter(&self) -> Iter<'_, (T, Vec<Piece>)> {
263263
self.routes.iter()
264264
}
265+
266+
pub fn into_iter(self) -> IntoIter<(T, Vec<Piece>)> {
267+
self.routes.into_iter()
268+
}
265269
}
266270

267271
/// Matched route path infomation.

0 commit comments

Comments
 (0)