Skip to content

document DoubleEndedIterator::next_back #34732

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

Merged
merged 1 commit into from
Jul 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/libcore/iter/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

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?

Copy link
Contributor

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."

Copy link
Member

@GuillaumeGomez GuillaumeGomez Jul 11, 2016

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. :-/

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 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 notifications@github.com
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
.

Copy link
Member

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.

///
/// As this is the only method for this trait, the [trait-level] docs
/// contain more details.
/// Returns `None` when there are no more elements.
///
/// The [trait-level] docs contain more details.
///
/// [trait-level]: trait.DoubleEndedIterator.html
///
Expand Down