@@ -79,7 +79,7 @@ use mem;
7979use option:: { None , Option , Some } ;
8080use result:: Result ;
8181use slice:: Vector ;
82- use slice:: { ImmutableVector , MutableVector , CloneableVector } ;
82+ use slice:: { ImmutableVector , MutableVector } ;
8383use string:: String ;
8484use vec:: Vec ;
8585
@@ -503,7 +503,7 @@ pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> MaybeOwned<'a> {
503503 res. push_bytes ( v. slice ( subseqidx, total) )
504504 } ;
505505 }
506- Owned ( res. into_owned ( ) )
506+ Owned ( res. into_string ( ) )
507507}
508508
509509/*
@@ -608,7 +608,7 @@ impl<'a> Str for MaybeOwned<'a> {
608608
609609impl < ' a > StrAllocating for MaybeOwned < ' a > {
610610 #[ inline]
611- fn into_owned ( self ) -> String {
611+ fn into_string ( self ) -> String {
612612 match self {
613613 Slice ( s) => s. to_string ( ) ,
614614 Owned ( s) => s
@@ -723,18 +723,18 @@ Section: Trait implementations
723723/// Any string that can be represented as a slice
724724pub trait StrAllocating : Str {
725725 /// Convert `self` into a `String`, not making a copy if possible.
726- fn into_owned ( self ) -> String ;
726+ fn into_string ( self ) -> String ;
727727
728728 /// Convert `self` into a `String`.
729729 #[ inline]
730730 fn to_string ( & self ) -> String {
731731 String :: from_str ( self . as_slice ( ) )
732732 }
733733
734- /// Convert `self` into a `String`, not making a copy if possible.
735- #[ inline ]
736- fn into_string ( self ) -> String {
737- self . into_owned ( )
734+ # [ allow ( missing_doc ) ]
735+ #[ deprecated = "replaced by .into_string()" ]
736+ fn into_owned ( self ) -> String {
737+ self . into_string ( )
738738 }
739739
740740 /// Escape each char in `s` with `char::escape_default`.
@@ -889,7 +889,7 @@ pub trait StrAllocating: Str {
889889
890890impl < ' a > StrAllocating for & ' a str {
891891 #[ inline]
892- fn into_owned ( self ) -> String {
892+ fn into_string ( self ) -> String {
893893 self . to_string ( )
894894 }
895895}
@@ -1045,7 +1045,7 @@ mod tests {
10451045 #[ test]
10461046 fn test_concat ( ) {
10471047 fn t ( v : & [ String ] , s : & str ) {
1048- assert_eq ! ( v. concat( ) , s. to_str( ) . into_owned ( ) ) ;
1048+ assert_eq ! ( v. concat( ) , s. to_str( ) . into_string ( ) ) ;
10491049 }
10501050 t ( [ "you" . to_string ( ) , "know" . to_string ( ) , "I'm" . to_string ( ) ,
10511051 "no" . to_string ( ) , "good" . to_string ( ) ] , "youknowI'mnogood" ) ;
@@ -1057,7 +1057,7 @@ mod tests {
10571057 #[ test]
10581058 fn test_connect ( ) {
10591059 fn t ( v : & [ String ] , sep : & str , s : & str ) {
1060- assert_eq ! ( v. connect( sep) , s. to_str( ) . into_owned ( ) ) ;
1060+ assert_eq ! ( v. connect( sep) , s. to_str( ) . into_string ( ) ) ;
10611061 }
10621062 t ( [ "you" . to_string ( ) , "know" . to_string ( ) , "I'm" . to_string ( ) ,
10631063 "no" . to_string ( ) , "good" . to_string ( ) ] ,
@@ -1070,7 +1070,7 @@ mod tests {
10701070 #[ test]
10711071 fn test_concat_slices ( ) {
10721072 fn t ( v : & [ & str ] , s : & str ) {
1073- assert_eq ! ( v. concat( ) , s. to_str( ) . into_owned ( ) ) ;
1073+ assert_eq ! ( v. concat( ) , s. to_str( ) . into_string ( ) ) ;
10741074 }
10751075 t ( [ "you" , "know" , "I'm" , "no" , "good" ] , "youknowI'mnogood" ) ;
10761076 let v: & [ & str ] = [ ] ;
@@ -1081,7 +1081,7 @@ mod tests {
10811081 #[ test]
10821082 fn test_connect_slices ( ) {
10831083 fn t ( v : & [ & str ] , sep : & str , s : & str ) {
1084- assert_eq ! ( v. connect( sep) , s. to_str( ) . into_owned ( ) ) ;
1084+ assert_eq ! ( v. connect( sep) , s. to_str( ) . into_string ( ) ) ;
10851085 }
10861086 t ( [ "you" , "know" , "I'm" , "no" , "good" ] ,
10871087 " " , "you know I'm no good" ) ;
@@ -2162,9 +2162,9 @@ mod tests {
21622162 }
21632163
21642164 #[ test]
2165- fn test_maybe_owned_into_owned ( ) {
2166- assert_eq ! ( Slice ( "abcde" ) . into_owned ( ) , "abcde" . to_string( ) ) ;
2167- assert_eq ! ( Owned ( "abcde" . to_string( ) ) . into_owned ( ) , "abcde" . to_string( ) ) ;
2165+ fn test_maybe_owned_into_string ( ) {
2166+ assert_eq ! ( Slice ( "abcde" ) . into_string ( ) , "abcde" . to_string( ) ) ;
2167+ assert_eq ! ( Owned ( "abcde" . to_string( ) ) . into_string ( ) , "abcde" . to_string( ) ) ;
21682168 }
21692169
21702170 #[ test]
0 commit comments