changed impl
This commit is contained in:
parent
e5e192a142
commit
09df88c80d
|
@ -1,3 +1,5 @@
|
|||
use std::fmt::Display;
|
||||
|
||||
use crate::value::Value;
|
||||
|
||||
/// Single-linked list
|
||||
|
@ -14,8 +16,13 @@ impl<'a> List<'a> {
|
|||
.rev()
|
||||
.fold(Self::Nil, |list, next| Self::Cons(next, Box::new(list)))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn iter(&self) -> Iter<'_, '_> {
|
||||
impl<'l, 'v> IntoIterator for &'l List<'v> {
|
||||
type Item = &'l Value<'v>;
|
||||
type IntoIter = Iter<'l, 'v>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
Iter(self)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue