-
Notifications
You must be signed in to change notification settings - Fork 13.5k
implement ExactSizeIterator
for slice::{Chunks,ChunksMut,Windows}
#21053
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
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -1212,6 +1212,9 @@ impl<'a, T> Iterator for Windows<'a, T> { | |||
} | |||
} | |||
|
|||
#[stable] | |||
impl<'a, T> ExactSizeIterator for Windows<'a, T> {} |
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.
This implementation may not forever be right as the above size_hint
may sometimes return None
for the upper bound (albeit somewhat rarely)
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.
I assume I should remove this impl, then?
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.
For now, yes, let's remove it until we're guaranteed that size_hint
always returns an exact size hint.
Thanks! Could you add some tests for the new implementations as well? |
Updated. |
@bors: r+ 1a76263 Thanks! |
I had to update this due to missing imports and a mutability issue in the tests. |
@bors: rollup |
No description provided.