Guest User

Untitled

a guest
May 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. fn main(){
  2. let mut a = (1..10).peekable();
  3. let b = std::iter::repeat(()).map(|()| {
  4. let mut current = a.next();
  5. if let Some(current) = current.as_mut() {
  6. if let Some(next) = a.peek() {
  7. if next % 2 == 1 { *current *= 2 }
  8. }
  9. }
  10. current
  11. });
  12. }
Add Comment
Please, Sign In to add comment