From a894c9aa6850a46bd372bba85a6c7b186b784014 Mon Sep 17 00:00:00 2001 From: Marc Bodmer Date: Thu, 6 Jun 2024 16:49:07 +0200 Subject: [PATCH] fix: implement IntoIterator for &PathTree Signed-off-by: Marc Bodmer --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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() } }