-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add is_empty
function to ExactSizeIterator
#34357
Conversation
All other types implementing a `len` functions have `is_empty` already.
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -519,6 +519,31 @@ pub trait ExactSizeIterator: Iterator { | |||
assert_eq!(upper, Some(lower)); | |||
lower | |||
} | |||
|
|||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustdoc might not like this leading empty doc comment line :)
For adding a method to many iterators we'll likely want to run this through crater to ensure that there's no unexpected fallout if we also decide to merge. |
Didn't we see a very similar PR to this one recently (adding is_empty to ... something) and decline to add it? I don't see it by searching old pulls. |
Maybe you mean #31877? |
Either that or perhaps |
The libs team discussed this during triage yesterday and the conclusion was that this is ok to merge pending a crater run |
Travis failure looks legit. |
Starting a crater run. |
@brson May I push a fix for the test failure or does that interfere with the crater run? |
@tbu- You can go ahead and push it now. There's a small window where it would have interfered. |
7dfe1a6
to
9e2c72f
Compare
9e2c72f
to
7b2a03f
Compare
@bors r+ |
📌 Commit 7b2a03f has been approved by |
Add `is_empty` function to `ExactSizeIterator` All other types implementing a `len` functions have `is_empty` already.
All other types implementing a
len
functions haveis_empty
already.