diff --git a/src/lib.rs b/src/lib.rs index 5a5df07..7b73a6d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; @@ -264,12 +264,12 @@ impl PathTree { } } -impl IntoIterator for PathTree { - type Item = (T, Vec); - type IntoIter = IntoIter<(T, Vec)>; +impl<'a, T> IntoIterator for &'a PathTree { + type Item = &'a (T, Vec); + type IntoIter = Iter<'a, (T, Vec)>; fn into_iter(self) -> Self::IntoIter { - self.routes.into_iter() + self.iter() } }