-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
An iterator returns None if it is empty, but Peekable's is_empty is defined like this:
pub fn is_empty(&mut self) -> bool {
self.peek().is_some()
}
https://github.com/mozilla/rust/blob/master/src/libstd/iter.rs#L1377
This needs to be changed to use is_none().
In fact, the code from test_peekable_is_empty() fails. It looks like this escaped detection because of a missing "#[test]"
Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.