You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The documentation of Vec contradicts itself regarding with_capacity #101316
This method is allowed to allocate for more elements than capacity.
And
If it is imporant to know the exact allocated capacity of a Vec, always use the capacity method after construction.
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". :(
Activity
ehuss commentedon Sep 2, 2022
I believe this is being worked on in #99790. Can you take a look at that PR and comment over there if it still seems unclear?
Kixunil commentedon Sep 2, 2022
Heh, was trying to find an issue but didn't think of looking at PRs. Will keep open until that merges.
jogru0 commentedon Apr 19, 2025
The documentation now says:
So I think the contradiction in the documentation is resolved and this issue can be closed, no?
Kixunil commentedon Apr 19, 2025
Oh, yes, I've seen that PR merged but forgot to close this.