Add doc comment to Vec::clone#157138
Conversation
|
r? @joboet rustbot has assigned @joboet. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
Good idea! The comment should however be a bit more vague about the actual capacity – we don't want to accidentally guarantee something we'd want to change later. How about saying that the capacity of the clone might not match the capacity of the original?
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
Makes sense. @rustbot ready |
This comment has been minimized.
This comment has been minimized.
|
Not sure what happened with the CI run |
|
@bors try jobs=x86_64-gnu-tools |
This comment has been minimized.
This comment has been minimized.
Add doc comment to `Vec::clone` try-job: x86_64-gnu-tools
|
The doc comment looks good to me. joboet might say this soon, but make sure to squash your commits to one. |
I have to squash manually? It doesn't happen with the PR merge? |
Yep. I think you could also do this through bors as well (though I've always squashed manually in my editor, so never tried it).
I believe the rustbot (or whoever has permissions to merge it into the main branch) do merge PRs, but I think the point of this is to simplify commit history. If I were to put my cursor on line 3813 in my code editor, it'll tell me that it belongs to commit 6803293; however, if I put it over the line 3817, it'll tell me that it belongs to commit cd22dda. It's just neater to see 4 commits you made as 1 within commit history and overall squashing makes it easier for people to find what was changed in that portion of code (e.g. in case we need to revert something in the future). You can check out this git section of rust compiler dev guide here for their git policy and tips. |
|
@bors squash msg="Add doc comment to |
This comment has been minimized.
This comment has been minimized.
|
🔨 4 commits were squashed into c812d6d. |
cd22dda to
c812d6d
Compare
I read about Clippy's
repeat_vec_with_capacitylint and figured it was worth adding a note about the relevant behavior to the documentation ofVec::cloneitself, which previously did not have its own doc comment.