Skip to content
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

Merged
merged 4 commits into from
Mar 9, 2018

Conversation

Songbird0
Copy link
Contributor

@Songbird0 Songbird0 commented Mar 4, 2018

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.
@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 4, 2018
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.
///
/// 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.
Copy link
Member

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.

///
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespaces
Copy link
Member

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.

@@ -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`].
///
Copy link
Member

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.

@@ -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.
Copy link
Member

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"?

Copy link
Contributor Author

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.

/// # 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
Copy link
Member

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.

@joshtriplett
Copy link
Member

One other minor nit (sorry for missing it the first time), and then this is ready to merge.

@Songbird0
Copy link
Contributor Author

Hi,

No problem, that was fixed.

@joshtriplett
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 5, 2018

@joshtriplett: 🔑 Insufficient privileges: not in try users

@bors
Copy link
Contributor

bors commented Mar 5, 2018

@joshtriplett: 🔑 Insufficient privileges: Not in reviewers

@Songbird0
Copy link
Contributor Author

Is there something wrong with bors, @joshtriplett?

@kennytm
Copy link
Member

kennytm commented Mar 7, 2018

@bors r=joshtriplett rollup

@bors
Copy link
Contributor

bors commented Mar 7, 2018

📌 Commit 6d71aa4 has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 7, 2018
@joshtriplett
Copy link
Member

@Songbird0 Yeah, rust-lang/rust-central-station#37 . Fixed now thanks to @alexcrichton.

@Songbird0
Copy link
Contributor Author

Nice!

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 8, 2018
…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.
bors added a commit that referenced this pull request Mar 8, 2018
Rollup of 7 pull requests

- Successful merges: #48292, #48682, #48699, #48738, #48752, #48789, #48808
- Failed merges:
@bors bors merged commit 6d71aa4 into rust-lang:master Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants