Skip to content

str: fix comments for FromStr for bool #22959

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

Closed
wants to merge 1 commit into from

Conversation

laijs
Copy link

@laijs laijs commented Mar 2, 2015

Fix the return type in the comments.

An old commit 082bfde ("Fallout of std::str stabilization") removed
the example of FromStr::from_str(), this commit adds it back. But
the example of StrExt::parse() is still kept with an additinal note.

Signed-off-by: Lai Jiangshan [email protected]

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

Fix the return type in the comments.

An old commit 082bfde ("Fallout of std::str stabilization") removed
the example of FromStr::from_str(), this commit adds it back. But
the example of StrExt::parse() is still kept with an additinal note.

Signed-off-by: Lai Jiangshan <[email protected]>
///
/// # Examples
///
/// ```rust
/// assert_eq!(from_str::<bool>("true"), OK(true));
/// assert_eq!(from_str::<bool>("false"), OK(false));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these instances of OK should be Ok instead. Also, I believe you can leave off the type annotations due to the usage of true and false to derive inference (but not in the error example below).

You can be sure to run these doc-blocks via make check-stage2-doc-crate-core

@laijs laijs closed this Mar 3, 2015
@laijs laijs deleted the fix_FromStr_bool_comment branch March 3, 2015 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants