Skip to content
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

Merged
merged 6 commits into from
Sep 17, 2019
Merged

adds stream::enumerate combinator #178

merged 6 commits into from
Sep 17, 2019

Conversation

montekki
Copy link
Member

/// c += 1;
/// }
/// #
/// # }) }
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, makes sense

Copy link
Contributor

@yoshuawuyts yoshuawuyts left a 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!

Copy link
Contributor

@yoshuawuyts yoshuawuyts left a 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.

Copy link

@ghost ghost left a 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 <stjepang@gmail.com>
@ghost
Copy link

ghost commented Sep 17, 2019

bors r+

bors bot added a commit that referenced this pull request Sep 17, 2019
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 <fedor.sakharov@gmail.com>
@bors
Copy link
Contributor

bors bot commented Sep 17, 2019

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 9487b73 into async-rs:master Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants