-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Improve documentation for <integer>::from_str_radix #128001
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
Thanks for including the screenshot; this is looking great! One request: can you put an example of the error case too? I think there's a bunch of people who are less likely to read the text in detail, but a @rustbot author |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
oops - incorrect rebase - ignore |
This comment was marked as resolved.
This comment was marked as resolved.
Two improvements to the documentation: - Document `-` as a valid character for signed integer destinations - Make the documentation even more clear that extra whitespace and non-digit characters is invalid. Many other languages, e.g. c++, are very permissive in string to integer routines and simply try to consume as much as they can, ignoring the rest. This is trying to make the transition for developers who are used to the conversion semantics in these languages a bit easier.
@rustbot review |
Thanks! Great to be clearer here for people reading these docs. @bors r+ rollup |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#128001 (Improve documentation for <integer>::from_str_radix) - rust-lang#130553 ([Clippy] Get rid of most `std` `match_def_path` usage, swap to diagnostic items.) - rust-lang#130554 (`pal::unsupported::process::ExitCode`: use an `u8` instead of a `bool`) - rust-lang#130556 (Mark the `link_cfg` feature as internal) - rust-lang#130558 (Support 128-bit atomics on s390x) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128001 - Krappa322:master, r=scottmcm Improve documentation for <integer>::from_str_radix Two improvements to the documentation: - Document `-` as a valid character for signed integer destinations - Make the documentation even more clear that extra whitespace and non-digit characters is invalid. Many other languages, e.g. c++, are very permissive in string to integer routines and simply try to consume as much as they can, ignoring the rest. This is trying to make the transition for developers who are used to the conversion semantics in these languages a bit easier.
Two improvements to the documentation:
-
as a valid character for signed integer destinations