@@ -2106,26 +2106,19 @@ impl ops::DerefMut for String {
2106
2106
}
2107
2107
}
2108
2108
2109
- /// An error when parsing a `String` .
2109
+ /// A type alias for [`Infallible`] .
2110
2110
///
2111
- /// This `enum` is slightly awkward: it will never actually exist. This error is
2112
- /// part of the type signature of the implementation of [`FromStr`] on
2113
- /// [`String`]. The return type of [`from_str`], requires that an error be
2114
- /// defined, but, given that a [`String`] can always be made into a new
2115
- /// [`String`] without error, this type will never actually be returned. As
2116
- /// such, it is only here to satisfy said signature, and is useless otherwise.
2111
+ /// This alias exists for backwards compatibility, and may be eventually deprecated.
2117
2112
///
2118
- /// [`FromStr`]: ../../std/str/trait.FromStr.html
2119
- /// [`String`]: struct.String.html
2120
- /// [`from_str`]: ../../std/str/trait.FromStr.html#tymethod.from_str
2113
+ /// [`Infallible`]: ../../core/convert/enum.Infallible.html
2121
2114
#[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2122
2115
pub type ParseError = core:: convert:: Infallible ;
2123
2116
2124
2117
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2125
2118
impl FromStr for String {
2126
2119
type Err = core:: convert:: Infallible ;
2127
2120
#[ inline]
2128
- fn from_str ( s : & str ) -> Result < String , ParseError > {
2121
+ fn from_str ( s : & str ) -> Result < String , Self :: Err > {
2129
2122
Ok ( String :: from ( s) )
2130
2123
}
2131
2124
}
0 commit comments