The documentation of Vec
contradicts itself regarding with_capacity
#101316
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
E-help-wanted
Call for participation: Help is requested to fix this issue.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Location
https://doc.rust-lang.org/std/vec/struct.Vec.html
Summary
In section Guarantees the documentation says:
However in
Vec::with_capacity(n)
it says:And
These clearly contradict each-other. I guess it's better for performance to not guarantee capacity but maybe it'd break someones code to change it since it was already "documented". :(
The text was updated successfully, but these errors were encountered: