File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 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 {
163163 }
164164}
165165
166- impl Into < String > for BoxedString {
167- fn into ( self ) -> String {
166+ impl From < BoxedString > for String {
167+ fn from ( s : BoxedString ) -> Self {
168168 #[ 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
172172 }
173173}
Original file line number Diff line number Diff line change @@ -865,12 +865,12 @@ impl<Mode: SmartStringMode> FromStr for SmartString<Mode> {
865865 }
866866}
867867
868- impl < Mode : SmartStringMode > Into < String > for SmartString < Mode > {
868+ impl < Mode : SmartStringMode > From < SmartString < Mode > > for String {
869869 /// Unwrap a boxed [`String`][String], or copy an inline string into a new [`String`][String].
870870 ///
871871 /// [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 ( ) {
874874 StringCastInto :: Boxed ( string) => string. into ( ) ,
875875 StringCastInto :: Inline ( string) => string. to_string ( ) ,
876876 }
You can’t perform that action at this time.
0 commit comments