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

Fixed typo in doc comments for swap_remove #41019

Merged
merged 3 commits into from
Apr 5, 2017

Conversation

mandeep
Copy link
Contributor

@mandeep mandeep commented Apr 2, 2017

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and return should be returns. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector.

Thoughts?

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (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.

@BurntSushi
Copy link
Member

Thanks!

@steveklabnik Thoughts on the re-wording suggested by @mandeep? Either variant seems fine to me.

@steveklabnik
Copy link
Member

Thoughts?

I agree that'd be a bit better; I think it ended up as a run-on due to trying to provide everything in the summary sentence. If we changed it to that, we'd split them up. That is:

/// Removes an element from anywhere in the vector and returns it.
///
/// The vector is mutated and the removed element is replaced by the last element of the vector.

I think I might write:

/// Removes an element from the vector and returns it.
///
/// The removed element is replaced by the last element of the vector.

If it's removed, then it's mutated, so this is redundant, and "from anywhere" also feels a bit redundant to me.

If you like either of these, you should add them onto this PR 👍

@mandeep
Copy link
Contributor Author

mandeep commented Apr 3, 2017

Thanks! I like your version so I've added a commit with the changes.

@BurntSushi
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 3, 2017

📌 Commit f74ca38 has been approved by BurntSushi

@BurntSushi
Copy link
Member

@mandeep Thanks!

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 3, 2017
…BurntSushi

Fixed typo in doc comments for swap_remove

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and ```return``` should be ```returns```. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of ```Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector. ```

Thoughts?
@frewsxcv
Copy link
Member

frewsxcv commented Apr 3, 2017

Looks like our tidy checker wants a line wrapped here:

/checkout/src/libcollections/vec.rs:682: trailing whitespace

@bors r-

@mandeep
Copy link
Contributor Author

mandeep commented Apr 3, 2017

@frewsxcv My fault! I've pushed a commit with the trailing whitespace removed.

@frewsxcv
Copy link
Member

frewsxcv commented Apr 3, 2017

Looks great, thanks!

@bors r=BurntSushi rollup

@bors
Copy link
Contributor

bors commented Apr 3, 2017

📌 Commit 5787808 has been approved by BurntSushi

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 4, 2017
…BurntSushi

Fixed typo in doc comments for swap_remove

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and ```return``` should be ```returns```. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of ```Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector. ```

Thoughts?
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 4, 2017
…BurntSushi

Fixed typo in doc comments for swap_remove

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and ```return``` should be ```returns```. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of ```Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector. ```

Thoughts?
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 5, 2017
…BurntSushi

Fixed typo in doc comments for swap_remove

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and ```return``` should be ```returns```. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of ```Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector. ```

Thoughts?
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 5, 2017
…BurntSushi

Fixed typo in doc comments for swap_remove

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and ```return``` should be ```returns```. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of ```Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector. ```

Thoughts?
bors added a commit that referenced this pull request Apr 5, 2017
@bors bors merged commit 5787808 into rust-lang:master Apr 5, 2017
@mandeep mandeep deleted the fix-vec-swapremove-docs branch April 7, 2017 20:42
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

Successfully merging this pull request may close these issues.

6 participants