@@ -515,7 +515,7 @@ impl GenericPath for PosixPath {
515515 fn with_filestem ( & self , s : & str ) -> PosixPath {
516516 match self . filetype ( ) {
517517 None => self . with_filename ( s) ,
518- Some ( ref t) => self . with_filename ( str :: to_owned ( s ) + * t) ,
518+ Some ( ref t) => self . with_filename ( s . to_owned ( ) + * t) ,
519519 }
520520 }
521521
@@ -657,7 +657,7 @@ impl GenericPath for WindowsPath {
657657 ( None , None ) => {
658658 host = None ;
659659 device = None ;
660- rest = str :: to_owned( s ) ;
660+ rest = s . to_owned( ) ;
661661 }
662662 }
663663
@@ -729,7 +729,7 @@ impl GenericPath for WindowsPath {
729729 fn with_filestem ( & self , s : & str ) -> WindowsPath {
730730 match self . filetype ( ) {
731731 None => self . with_filename ( s) ,
732- Some ( ref t) => self . with_filename ( str :: to_owned ( s ) + * t) ,
732+ Some ( ref t) => self . with_filename ( s . to_owned ( ) + * t) ,
733733 }
734734 }
735735
@@ -984,7 +984,7 @@ mod tests {
984984 fn test_posix_paths() {
985985 fn t(wp: &PosixPath, s: &str) {
986986 let ss = wp.to_str();
987- let sss = str:: to_owned(s );
987+ let sss = s. to_owned();
988988 if (ss != sss) {
989989 debug!(" got %s", ss);
990990 debug!(" expected %s", sss);
@@ -1042,7 +1042,7 @@ mod tests {
10421042 fn test_normalize ( ) {
10431043 fn t ( wp : & PosixPath , s : & str ) {
10441044 let ss = wp. to_str ( ) ;
1045- let sss = str :: to_owned ( s ) ;
1045+ let sss = s . to_owned ( ) ;
10461046 if ( ss != sss) {
10471047 debug ! ( "got %s" , ss) ;
10481048 debug ! ( "expected %s" , sss) ;
@@ -1105,7 +1105,7 @@ mod tests {
11051105 fn test_windows_paths( ) {
11061106 fn t( wp: & WindowsPath , s: & str ) {
11071107 let ss = wp. to_str( ) ;
1108- let sss = str :: to_owned( s ) ;
1108+ let sss = s . to_owned( ) ;
11091109 if ( ss != sss) {
11101110 debug!( "got %s" , ss) ;
11111111 debug!( "expected %s" , sss) ;
0 commit comments