-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add remark regarding DoubleEndedIterator #72626
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dtolnay (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that code is a helpful demo of this behavior.
@bors r+ rollup |
📌 Commit b60fe39 has been approved by |
…olnay Add remark regarding DoubleEndedIterator While reviewing rust-itertools/itertools@14293bd#diff-2c16d2ada06ad2fd1fc754679646d471, I realized that a `DoubleEndedIterator` may yield different elements depending on whether it is traversed forwards or backwards. (Not only the *order*, but possibly also the yielded values.) I found this remarkable, but could not find anything in the current docs, so I thought it may be worth mentioning this explicitly. Unfortunately, I could not test these changes locally (`rustdoc` complains about `unresolved import`). Sorry if this causes headache. If I should change something, please let me know. If it seems too trivial, feel free to just close this PR.
Rollup of 6 pull requests Successful merges: - rust-lang#72348 (Fix confusing error message for comma typo in multiline statement) - rust-lang#72533 (Resolve UB in Arc/Weak interaction (2)) - rust-lang#72548 (Add test for old compiler ICE when using `Borrow`) - rust-lang#72606 (Small cell example update) - rust-lang#72610 (Remove font-display settings) - rust-lang#72626 (Add remark regarding DoubleEndedIterator) Failed merges: r? @ghost
I stumbled upon the comment and found it definitely useful but hard to understand, and I'm no longer a noob. The sentence "The elements yielded by I suggest it should be about how backward iteration differs from forward iteration, and belongs at the trait level. Or that it limits itself to |
While reviewing rust-itertools/itertools@14293bd#diff-2c16d2ada06ad2fd1fc754679646d471, I realized that a
DoubleEndedIterator
may yield different elements depending on whether it is traversed forwards or backwards. (Not only the order, but possibly also the yielded values.)I found this remarkable, but could not find anything in the current docs, so I thought it may be worth mentioning this explicitly.
Unfortunately, I could not test these changes locally (
rustdoc
complains aboutunresolved import
). Sorry if this causes headache.If I should change something, please let me know. If it seems too trivial, feel free to just close this PR.