File tree 2 files changed +8
-8
lines changed 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -163,11 +163,11 @@ impl From<String> for BoxedString {
163
163
}
164
164
}
165
165
166
- impl Into < String > for BoxedString {
167
- fn into ( self ) -> String {
166
+ impl From < BoxedString > for String {
167
+ fn from ( s : BoxedString ) -> Self {
168
168
#[ allow( unsafe_code) ]
169
- let s = unsafe { String :: from_raw_parts ( self . ptr . as_ptr ( ) , self . len ( ) , self . capacity ( ) ) } ;
170
- forget ( self ) ;
171
- s
169
+ let out = unsafe { String :: from_raw_parts ( s . ptr . as_ptr ( ) , s . len ( ) , s . capacity ( ) ) } ;
170
+ forget ( s ) ;
171
+ out
172
172
}
173
173
}
Original file line number Diff line number Diff line change @@ -865,12 +865,12 @@ impl<Mode: SmartStringMode> FromStr for SmartString<Mode> {
865
865
}
866
866
}
867
867
868
- impl < Mode : SmartStringMode > Into < String > for SmartString < Mode > {
868
+ impl < Mode : SmartStringMode > From < SmartString < Mode > > for String {
869
869
/// Unwrap a boxed [`String`][String], or copy an inline string into a new [`String`][String].
870
870
///
871
871
/// [String]: https://doc.rust-lang.org/std/string/struct.String.html
872
- fn into ( self ) -> String {
873
- match self . cast_into ( ) {
872
+ fn from ( s : SmartString < Mode > ) -> Self {
873
+ match s . cast_into ( ) {
874
874
StringCastInto :: Boxed ( string) => string. into ( ) ,
875
875
StringCastInto :: Inline ( string) => string. to_string ( ) ,
876
876
}
You can’t perform that action at this time.
0 commit comments