by davidatbu · 4y ago · 0 comments
trait LendingIterator<'a, T> {
fn next(&'a mut self) -> Option<&'a T>;
}
impl<'a, T> LendingIterator<'a, T> for Whatever {
fn next(&'a mut self) -> Option<&'a T> {
todo!()
}
}
And of course, you'd modify the for loop syntax to desugar appropriately if the the iterator implements LendingIterator.