-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
std: Add capacity guarantees notes for OsString #95394
Conversation
Signed-off-by: Xuanwo <github@xuanwo.io>
(rust-highfive has picked a reviewer for you, use r? to override) |
@rustbot modify labels: +T-libs-api |
r? @dtolnay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think copying the same cursory 1-sentence comment into 7 different places is not the best way to accomplish this documentation. I would prefer to see a single section that explains this topic more clearly in detail, probably with example code to illustrate some correct and incorrect uses of the APIs where this guarantee is relevant. Especially showing the incorrect case is important to illustrate the limitations of this guarantee (the "not specified" case).
This section would probably be most appropriate on the OsString
type but alternatively on the capacity()
method could work too, depending on how you write it. Everywhere else where that content is important to understand can just link to it.
Updated version in #97202 . |
…ntation, r=dtolnay os str capacity documentation This is based on rust-lang#95394 , with expansion and consolidation to address comments from `@dtolnay` and other `@rust-lang/libs-api` team members.
…r=dtolnay os str capacity documentation This is based on rust-lang/rust#95394 , with expansion and consolidation to address comments from `@dtolnay` and other `@rust-lang/libs-api` team members.
This PR intends to stabilize feature
try_reserve_2
, part of #91789This PR will is split from #95392