Merge pull request #2409 from montrivo/while_let_on_iterator

#1121: already fixed, adding a test
This commit is contained in:
Oliver Schneider 2018-01-29 19:21:00 +01:00 committed by GitHub
commit 4e467661c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -193,4 +193,12 @@ fn refutable() {
break None; break None;
} }
}; };
use std::collections::HashSet;
let mut values = HashSet::new();
values.insert(1);
while let Some(&value) = values.iter().next() {
values.remove(&value);
}
} }