File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ pub mod pattern;
2020#[ allow( missing_docs) ]
2121pub mod lossy;
2222
23- /// A trait to abstract the idea of creating a new instance of a type from a
24- /// string.
23+ /// Parse a value from a string
2524///
2625/// `FromStr`'s [`from_str`] method is often used implicitly, through
2726/// [`str`]'s [`parse`] method. See [`parse`]'s documentation for examples.
@@ -30,6 +29,11 @@ pub mod lossy;
3029/// [`str`]: ../../std/primitive.str.html
3130/// [`parse`]: ../../std/primitive.str.html#method.parse
3231///
32+ /// `FromStr` does not have a lifetime parameter, and so you can only parse types
33+ /// that do not contain a lifetime parameter themselves. In other words, you can
34+ /// parse an `i32` with `FromStr`, but not a `&i32`. You can parse a struct that
35+ /// contains an `i32`, but not one that contains an `&i32`.
36+ ///
3337/// # Examples
3438///
3539/// Basic implementation of `FromStr` on an example `Point` type:
You can’t perform that action at this time.
0 commit comments