-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add Rev delegate methods for the impl of Iterator. #57245
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? @TimNN (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This does three things:
|
f637ab5
to
d752f81
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The third is negotiable. It breaks multiple methods to use |
These change the execution order and cannot be merged as-is, unfortunately: let iter = || (1..=10).map(|x| println!("{}", x));
iter().count(); // prints 1-10
iter().rev().count(); // prints 10-1
iter().next(); // prints 1
iter().rev().last(); // prints 10-1 |
@clarcharr That's a great point. I'll make a PR that makes tests for these. |
I'm keeping the PR open for right now so I remember to work on this. |
ping from triage @czipperz any updates on this? |
@Dylan-DPC I'm working on other things right now. Do you think I should add tests ensuring this functionality or it is fine as is? |
The only method addition that would improve performance without breaking functionality was |
No description provided.