-
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
doc: Method examples for String #16027
Conversation
@@ -42,6 +48,14 @@ impl String { | |||
} | |||
|
|||
/// Creates a new string buffer with the given capacity. | |||
/// The string will be able to hold exactly `capacity` elements without | |||
/// reallocating. If `capacity` is 0, the string will not allocate. |
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.
😍
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.
With strings the term "elements" may refer to more than one concept, so could you explicitly say that it will hold exactly the number of bytes?
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.
Ah yes, good catch.
r=me with a slightly improved UTF-8 wording |
Fair points, thanks. |
Looks good to me! Could you squash the commits as well? |
Reword comments on unsafe methods regarding UTF-8.
Squashed. |
feat: Implicit format args support Fixes rust-lang/rust-analyzer#11260 Fixes rust-lang/rust-analyzer#11296 ![image](https://github.com/rust-lang/rust-analyzer/assets/3757771/14fe2caf-4ea3-40a5-8aa4-ff08ea0ccbde) Too lazy to make a gif of this right now (would probably be good to show renaming)
No description provided.