Trying to understand GATs (the lending iterator example)
The Rust Programming Language Forum
Trying to understand GATs (the lending iterator example)
Hello! Could someone please explain how the flexibility around lifetimes here has helped us write this nice implementation below? Would really appreciate an explanation covering all the lifetime details! Thanks 😃 use ::core::mem; pub trait LendingIterator { type Item<'this> where Self: 'this; fn next(&mut self) -> Option<Self::Item<'_>>; } pub fn windows_mut<T, const WINDOW_SIZE: usize>(slice: &mut [T]) -> WindowsMut<'_, T, WINDOW_SIZE> { assert_ne!(WINDOW_SIZE,...
0 comments
No comments yet.