Skip to content

Conversation

bluss
Copy link
Contributor

@bluss bluss commented Aug 3, 2013

Fix #8228 by replacing .iter() and .iter_err() in Result by external iterators.

Implement random access for iterator::Invert and vec::ChunkIter (and bidirectionality).

Implement Repeat iterator.

@bluss
Copy link
Contributor Author

bluss commented Aug 3, 2013

Needs to go in after the snapshot pull #8264

Copy link
Member

Choose a reason for hiding this comment

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

To follow the pattern of HashMap, could this be called consume?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well I don't agree -- there are still many consume_iter around too -- but that's just how my mind is set.

@bluss
Copy link
Contributor Author

bluss commented Aug 3, 2013

Thanks for the comments! Updated to address them.

I removed the commit to remove uint::iterate because it conflicts with the snapshot PR.

@bluss
Copy link
Contributor Author

bluss commented Aug 3, 2013

um my hashmap change is not that brilliant. it's probably even better to just use .scan()

@bluss
Copy link
Contributor Author

bluss commented Aug 4, 2013

uint::iterate removal is back, because the snapshot landed.

@bluss
Copy link
Contributor Author

bluss commented Aug 6, 2013

Rebased. Still a branch of "assorted changes", I'm happy to hear if this can go in, or what can be improved.

@bluss
Copy link
Contributor Author

bluss commented Aug 6, 2013

I guess it will conflict with the std::result PR

blake2-ppc added 12 commits August 6, 2013 03:59
Let Option be a base for a widely useful one- or zero- item iterator.
Refactor OptionIterator to support any generic element type, so the same
iterator impl can be used for both &T, &mut T and T iterators.
convert iter() and iter_err() for Result. Use OptionIterator.
Implement clone, bidirectionality and random access for this iterator
Use the Repeat iterator to carry the "explicit closure capture" that was
previously done with the custom EnvFilterIterator.
With Option as the simplest container, `consume` is the way to turn it
into a by-value iterator.
ChunkIter .idx() didn't handle overflow correctly, even though it tried.
bors added a commit that referenced this pull request Aug 6, 2013
Fix #8228 by replacing .iter() and .iter_err() in Result by external iterators.

Implement random access for `iterator::Invert` and `vec::ChunkIter` (and bidirectionality).

Implement Repeat iterator.
@bors bors closed this Aug 6, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 13, 2022
Cache rustfmt path

changelog: none

Call `rustup which rustfmt` and use the output. This shaves off  ~0.7 seconds for `cargo dev fmt` for me.
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.

Replace internal iteration functions in std::either and std::result

3 participants