Add Rev delegate methods for the impl of Iterator.#57245
Add Rev delegate methods for the impl of Iterator.#57245czipperz wants to merge 4 commits intorust-lang:masterfrom
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.