Skip to content

Commit 4e8afd6

Browse files
author
Ulrik Sverdrup
committed
docs: Update FromStr documentation
Fixes rust-lang#25250
1 parent 9ecc989 commit 4e8afd6

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
@@ -44,8 +44,11 @@ pub trait FromStr {
4444
#[stable(feature = "rust1", since = "1.0.0")]
4545
type Err;
4646

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

0 commit comments

Comments
 (0)