-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
document DoubleEndedIterator::next_back #34732
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @apasel422 |
@@ -386,10 +386,11 @@ pub trait Extend<A> { | |||
/// ``` | |||
#[stable(feature = "rust1", since = "1.0.0")] | |||
pub trait DoubleEndedIterator: Iterator { | |||
/// An iterator able to yield elements from both ends. | |||
/// Removes and returns an element from the end of the iterator. |
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.
It really removes an element from the iterated object?
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.
This might be better as something like "Yields an element from the back of the iterator."
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.
Both sound inaccurate to me. :-/
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.
Well it does remove an element. So does next()
(from the beginning). Why
do you think this sounds wrong?
On Mon, Jul 11, 2016 at 11:16 AM, Guillaume Gomez [email protected]
wrote:
In src/libcore/iter/traits.rs
#34732 (comment):@@ -386,10 +386,11 @@ pub trait Extend {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub trait DoubleEndedIterator: Iterator {
- /// An iterator able to yield elements from both ends.
- /// Removes and returns an element from the end of the iterator.
Both sounds inaccurate to me. :-/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rust-lang/rust/pull/34732/files/b4ff6b028ed6ae2e67d97604ad6bfbd235bb4f74#r70277691,
or mute the thread
https://github.com/notifications/unsubscribe/AAC3nwp6zp2zpXgSnW_EAfiiwCdWX9-eks5qUl5ogaJpZM4JIh0J
.
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.
As I understand it, when I reread the array (but calling again .iter()
), the elements have been removed. If that's the case then all good.
Ping @steveklabnik |
@bors: r+ rollup |
📌 Commit b4ff6b0 has been approved by |
document DoubleEndedIterator::next_back document DoubleEndedIterator::next_back fixes rust-lang#34726
⌛ Testing commit b4ff6b0 with merge c23561c... |
💔 Test failed - auto-win-msvc-64-opt |
@bors: retry On Tue, Jul 26, 2016 at 4:05 AM, bors [email protected] wrote:
|
document DoubleEndedIterator::next_back document DoubleEndedIterator::next_back fixes rust-lang#34726
document DoubleEndedIterator::next_back
fixes #34726