Skip to content

iterator: Add IteratorUtil::peek_ method #7604

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

Merged
merged 1 commit into from Jul 8, 2013
Merged

iterator: Add IteratorUtil::peek_ method #7604

merged 1 commit into from Jul 8, 2013

Conversation

ghost
Copy link

@ghost ghost commented Jul 5, 2013

This can be useful for inserting debugging code at different steps in an iterator pipeline.

@emberian
Copy link
Member

emberian commented Jul 7, 2013

@apasel422 legitimate failure:

/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt/build/src/libstd/iterator.rs:1090:4: 1092:5 error: method `size_hint` has an incompatible type: expected uint but found enum option::Option
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt/build/src/libstd/iterator.rs:1090     fn size_hint(&self) -> (Option<uint>, Option<uint>) {
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt/build/src/libstd/iterator.rs:1091         self.iter.size_hint()
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt/build/src/libstd/iterator.rs:1092     }
error: aborting due to previous error
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so] Error 101

The size_hint API changed, the lower bound is no longer an Option (because None is semantically equivalent to 0, for the lower bound, always)

@ghost
Copy link
Author

ghost commented Jul 8, 2013

@cmr: Fixed.

bors added a commit that referenced this pull request Jul 8, 2013
This can be useful for inserting debugging code at different steps in an iterator pipeline.
@bors bors closed this Jul 8, 2013
@bors bors merged commit 7bb4ff6 into rust-lang:master Jul 8, 2013
@ghost ghost deleted the peek branch July 8, 2013 19:52
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 3, 2021
Rustup

I'll write some TODOs later. This time I'll need a review for this Rustup

r? `@ghost`  (for now)

changelog: none
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.

3 participants