Skip to content

Commit

Permalink
feat: also add into_iter()
Browse files Browse the repository at this point in the history
clippy requests an implementation of into_iter()
when implementing iter()

Signed-off-by: Marc Bodmer <[email protected]>
  • Loading branch information
mbodmer committed Jun 6, 2024
1 parent 3cff541 commit 176e2a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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::Vec,
vec::{IntoIter, Vec},
};
use core::{slice::Iter, str::from_utf8};
use smallvec::SmallVec;
Expand Down Expand Up @@ -262,6 +262,10 @@ impl<T> PathTree<T> {
pub fn iter(&self) -> Iter<'_, (T, Vec<Piece>)> {
self.routes.iter()
}

pub fn into_iter(self) -> IntoIter<(T, Vec<Piece>)> {
self.routes.into_iter()
}
}

/// Matched route path infomation.
Expand Down

0 comments on commit 176e2a3

Please sign in to comment.