@@ -1019,27 +1019,44 @@ impl AsRef<str> for String {
1019
1019
1020
1020
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1021
1021
impl < ' a > From < & ' a str > for String {
1022
+ #[ inline]
1022
1023
fn from ( s : & ' a str ) -> String {
1023
1024
s. to_string ( )
1024
1025
}
1025
1026
}
1026
1027
1028
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1029
+ impl < ' a > From < & ' a str > for Cow < ' a , str > {
1030
+ #[ inline]
1031
+ fn from ( s : & ' a str ) -> Cow < ' a , str > {
1032
+ Cow :: Borrowed ( s)
1033
+ }
1034
+ }
1035
+
1036
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1037
+ impl < ' a > From < String > for Cow < ' a , str > {
1038
+ #[ inline]
1039
+ fn from ( s : String ) -> Cow < ' a , str > {
1040
+ Cow :: Owned ( s)
1041
+ }
1042
+ }
1043
+
1027
1044
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1028
1045
impl Into < Vec < u8 > > for String {
1029
1046
fn into ( self ) -> Vec < u8 > {
1030
1047
self . into_bytes ( )
1031
1048
}
1032
1049
}
1033
1050
1034
- #[ stable ( feature = "rust1 " , since = "1.0.0 " ) ]
1051
+ #[ unstable ( feature = "into_cow " , reason = "may be replaced by `convert::Into` " ) ]
1035
1052
impl IntoCow < ' static , str > for String {
1036
1053
#[ inline]
1037
1054
fn into_cow ( self ) -> Cow < ' static , str > {
1038
1055
Cow :: Owned ( self )
1039
1056
}
1040
1057
}
1041
1058
1042
- #[ stable ( feature = "rust1 " , since = "1.0.0 " ) ]
1059
+ #[ unstable ( feature = "into_cow " , reason = "may be replaced by `convert::Into` " ) ]
1043
1060
impl < ' a > IntoCow < ' a , str > for & ' a str {
1044
1061
#[ inline]
1045
1062
fn into_cow ( self ) -> Cow < ' a , str > {
0 commit comments