-
Notifications
You must be signed in to change notification settings - Fork 341
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
adds stream::enumerate combinator #178
Conversation
/// c += 1; | ||
/// } | ||
/// # | ||
/// # }) } |
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 is a great test! But I feel like the example from Iterator::enumerate
was a little clearer in its intent:
let a = ['a', 'b', 'c'];
let mut iter = a.iter().enumerate();
assert_eq!(iter.next(), Some((0, &'a')));
assert_eq!(iter.next(), Some((1, &'b')));
assert_eq!(iter.next(), Some((2, &'c')));
assert_eq!(iter.next(), None);
Perhaps manually calling next().await
might make it easier to follow?
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.
yep, makes sense
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.
The implementation is looking 💯 -- thanks so much!
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.
LGTM -- going to leave it to @stjepang for the final review. We're two weeks out from needing to stabilize our full API so this might be held up for a little bit.
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.
Thanks! :) I only have a small nit.
Co-Authored-By: Stjepan Glavina <[email protected]>
bors r+ |
178: adds stream::enumerate combinator r=stjepang a=montekki enumerate might be handy. --- Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.enumerate Ref: #129 Co-authored-by: Fedor Sakharov <[email protected]>
Build succeeded
|
enumerate might be handy.
Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.enumerate
Ref: #129