Skip to content

Commit 00f2157

Browse files
author
Ulrik Sverdrup
committed
docs: Update FromStr documentation
Fixes rust-lang#25250
1 parent 6cd7486 commit 00f2157

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libcore/str/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ pub trait FromStr {
4343
#[stable(feature = "rust1", since = "1.0.0")]
4444
type Err;
4545

46-
/// Parses a string `s` to return an optional value of this type. If the
47-
/// string is ill-formatted, the None is returned.
46+
/// Parses a string `s` to return a value of this type.
47+
///
48+
/// If parsing succeeds, return the value inside `Ok`, otherwise
49+
/// when the string is ill-formatted return an error specific to the
50+
/// inside `Err`. The error type is specific to implementation of the trait.
4851
#[stable(feature = "rust1", since = "1.0.0")]
4952
fn from_str(s: &str) -> Result<Self, Self::Err>;
5053
}

0 commit comments

Comments
 (0)