-
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
Add a potential cause raising ParseIntError
.
#48738
Add a potential cause raising ParseIntError
.
#48738
Conversation
Initially, I wanted to add it directly to the documentation of `str. parse()' method, I finally found that it was more relevant (I hope so?) to directly document the structure in question. I've added a scenario, in which we could all get caught at least once, to make it easier to diagnose the problem when parsing integers.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
The error was: ``` [00:05:25] tidy error: /checkout/src/libcore/num/mod.rs:3848: trailing whitespace [00:05:25] tidy error: /checkout/src/libcore/num/mod.rs:3851: line longer than 100 chars [00:05:25] tidy error: /checkout/src/libcore/num/mod.rs:3851: trailing whitespace [00:05:26] some tidy checks failed ``` The line was truncated to 92 characters.
src/libcore/num/mod.rs
Outdated
/// | ||
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespaces | ||
/// in the string e.g. when it is getted from the standard input. |
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.
Whitespace at the end of the line.
src/libcore/num/mod.rs
Outdated
/// | ||
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespaces |
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.
Whitespace at the end of the line.
src/libcore/num/mod.rs
Outdated
@@ -3845,7 +3845,14 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par | |||
/// | |||
/// This error is used as the error type for the `from_str_radix()` functions | |||
/// on the primitive integer types, such as [`i8::from_str_radix`]. | |||
/// |
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.
Whitespace at the end of the line.
src/libcore/num/mod.rs
Outdated
@@ -3848,7 +3848,8 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par | |||
/// | |||
/// # Potential causes | |||
/// | |||
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespaces in the string e.g. when it is getted from the standard input. | |||
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespaces | |||
/// in the string e.g. when it is getted from the standard input. |
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.
"getted' doesn't work here. Perhaps "when obtained from the standard input"?
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.
Yes, forgive my English. I'll write that down.
src/libcore/num/mod.rs
Outdated
/// # Potential causes | ||
/// | ||
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespaces | ||
/// in the string e.g. when it is getted from the standard input. | ||
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespaces |
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.
"whitespaces" should be "whitespace" here; it's a mass noun.
One other minor nit (sorry for missing it the first time), and then this is ready to merge. |
Hi, No problem, that was fixed. |
@bors r+ rollup |
@joshtriplett: 🔑 Insufficient privileges: not in try users |
@joshtriplett: 🔑 Insufficient privileges: Not in reviewers |
Is there something wrong with bors, @joshtriplett? |
@bors r=joshtriplett rollup |
📌 Commit 6d71aa4 has been approved by |
@Songbird0 Yeah, rust-lang/rust-central-station#37 . Fixed now thanks to @alexcrichton. |
Nice! |
…ause, r=joshtriplett Add a potential cause raising `ParseIntError`. Initially, I wanted to add it directly to the documentation of `str. parse()` method, I finally found that it was more relevant (I hope so?) to directly document the structure in question. I've added a scenario, in which we could all get caught at least once, to make it easier to diagnose the problem when parsing integers.
Initially, I wanted to add it directly to the documentation of
str. parse()
method, I finally found that it was more relevant (I hope so?) to directly document the structure in question. I've added a scenario, in which we could all get caught at least once, to make it easier to diagnose the problem when parsing integers.