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

Vec(Deque)::truncate documentation says 'greater' when it should say 'greater or equal' #115784

Closed
jplatte opened this issue Sep 12, 2023 · 2 comments · Fixed by #115895
Closed
Assignees
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@jplatte
Copy link
Contributor

jplatte commented Sep 12, 2023

Location

https://doc.rust-lang.org/std/vec/struct.Vec.html#method.truncate

Summary

The documentation currently says

If len is greater than the vector’s current length, this has no effect.

But it also doesn't have an effect if the two lengths are equal, so I think it should say "greater or equal to the vector's current length".

@jplatte jplatte added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Sep 12, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 12, 2023
@saethlin saethlin added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 12, 2023
@chenyukang
Copy link
Member

yes, there is a trivial difference between > len and = len,
#78884

but it's an internal implementation issue, I think we should update the doc since they are same from the user's view.

@chenyukang chenyukang added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Sep 15, 2023
@52
Copy link
Contributor

52 commented Sep 15, 2023

@rustbot claim

rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 16, 2023
Rollup merge of rust-lang#115895 - 52:patch-docs-vec-truncate, r=dtolnay

Improve Vec(Deque)::truncate documentation

Fixes rust-lang#115784
@bors bors closed this as completed in e2ea347 Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants