about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorUlrik Sverdrup <root@localhost>2015-05-11 00:22:04 +0200
committerUlrik Sverdrup <root@localhost>2015-05-11 03:41:53 +0200
commit4e8afd65f93f1c351365c71f4461a2c6728f8287 (patch)
tree53ac8552dd6324ed6efe21c5a0fbe7bed75688fb /src/libcore
parent9ecc9896dedb426e3f4eb3d23dfc60192fe5275f (diff)
downloadrust-4e8afd65f93f1c351365c71f4461a2c6728f8287.tar.gz
rust-4e8afd65f93f1c351365c71f4461a2c6728f8287.zip
docs: Update FromStr documentation
Fixes #25250
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/str/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 4d39607b16e..11ca6e332b5 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -44,8 +44,11 @@ pub trait FromStr {
     #[stable(feature = "rust1", since = "1.0.0")]
     type Err;
 
-    /// Parses a string `s` to return an optional value of this type. If the
-    /// string is ill-formatted, the None is returned.
+    /// Parses a string `s` to return a value of this type.
+    ///
+    /// If parsing succeeds, return the value inside `Ok`, otherwise
+    /// when the string is ill-formatted return an error specific to the
+    /// inside `Err`. The error type is specific to implementation of the trait.
     #[stable(feature = "rust1", since = "1.0.0")]
     fn from_str(s: &str) -> Result<Self, Self::Err>;
 }