You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.take() and .skip() (gracefully) don't panic when doing something like [1, 2, 3].iter().skip(4). We should lint this and say that it makes no sense since it'll either return the full iterator or an empty iterator.
Advantage
The code is useless in both scenarios
Drawbacks
No response
Example
for _ in[1,2,3].iter().skip(4){unreachable!();}for(i, _)in[1,2,3].iter().take(4).enumerate(){assert!(i <= 2);}