Skip to content
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

VecDeque docs should mention in which direction indices go #34920

Closed
hanna-kruppe opened this issue Jul 19, 2016 · 7 comments
Closed

VecDeque docs should mention in which direction indices go #34920

hanna-kruppe opened this issue Jul 19, 2016 · 7 comments

Comments

@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Jul 19, 2016

It's not clear to me whether index 0 is the front or the back of the deque. For example, the std::collections::vec_deque module docs only say "It also has O(1) indexing like a vector." and the documentation of VecDeque::get only states "Retrieves an element in the VecDeque by index." and the example retrieves the middle element of a three-element deque. From the iteration order, or the example in swap, I can infer that it's from the front (and of course I could try it out) but it's would have saved me some time if it was just stated up-front in the relevant locations.

@GuillaumeGomez
Copy link
Member

Interested in doing it? It is quite an easy change. :)

@abhijeetbhagat
Copy link
Contributor

I can work on this.

@GuillaumeGomez
Copy link
Member

@abhijeetbhagat: Please do.

@abhijeetbhagat
Copy link
Contributor

r? @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

@abhijeetbhagat: I need a PR to review. 😛

steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 25, 2016
…Gomez

Update VecDeque documentation to specify direction of index 0 (rust-lang#34920)

I mentioned the direction for all the methods that work with an index
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 26, 2016
…Gomez

Update VecDeque documentation to specify direction of index 0 (rust-lang#34920)

I mentioned the direction for all the methods that work with an index
@mgattozzi
Copy link
Contributor

@GuillaumeGomez since this change got merged you might want to close the issue. I just came across this browsing the docs tag thinking it was still open.

@GuillaumeGomez
Copy link
Member

@mgattozzi: Thanks for notifying me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants