@@ -477,7 +477,7 @@ impl GenericPath for PosixPath {
477477 fn with_filestem ( & self , s : & str ) -> PosixPath {
478478 match self . filetype ( ) {
479479 None => self . with_filename ( s) ,
480- Some ( ref t) => self . with_filename ( str:: from_slice ( s) + * t)
480+ Some ( ref t) => self . with_filename ( str:: to_owned ( s) + * t)
481481 }
482482 }
483483
@@ -488,7 +488,7 @@ impl GenericPath for PosixPath {
488488 Some ( ref s) => self . with_filename ( * s)
489489 }
490490 } else {
491- let t = ~". " + str:: from_slice ( t) ;
491+ let t = ~". " + str:: to_owned ( t) ;
492492 match self . filestem ( ) {
493493 None => self . with_filename ( t) ,
494494 Some ( ref s) => self . with_filename ( * s + t)
@@ -621,7 +621,7 @@ impl GenericPath for WindowsPath {
621621 None => {
622622 host = None ;
623623 device = None ;
624- rest = str:: from_slice ( s) ;
624+ rest = str:: to_owned ( s) ;
625625 }
626626 }
627627 }
@@ -694,7 +694,7 @@ impl GenericPath for WindowsPath {
694694 fn with_filestem ( & self , s : & str ) -> WindowsPath {
695695 match self . filetype ( ) {
696696 None => self . with_filename ( s) ,
697- Some ( ref t) => self . with_filename ( str:: from_slice ( s) + * t)
697+ Some ( ref t) => self . with_filename ( str:: to_owned ( s) + * t)
698698 }
699699 }
700700
@@ -705,7 +705,7 @@ impl GenericPath for WindowsPath {
705705 Some ( ref s) => self . with_filename ( * s)
706706 }
707707 } else {
708- let t = ~". " + str:: from_slice ( t) ;
708+ let t = ~". " + str:: to_owned ( t) ;
709709 match self . filestem ( ) {
710710 None => self . with_filename ( t) ,
711711 Some ( ref s) =>
@@ -956,7 +956,7 @@ mod tests {
956956 fn test_posix_paths() {
957957 fn t(wp: &PosixPath, s: &str) {
958958 let ss = wp.to_str();
959- let sss = str::from_slice (s);
959+ let sss = str::to_owned (s);
960960 if (ss != sss) {
961961 debug!(" got %s", ss);
962962 debug!(" expected %s", sss);
@@ -1014,7 +1014,7 @@ mod tests {
10141014 fn test_normalize ( ) {
10151015 fn t ( wp : & PosixPath , s : & str ) {
10161016 let ss = wp. to_str ( ) ;
1017- let sss = str:: from_slice ( s) ;
1017+ let sss = str:: to_owned ( s) ;
10181018 if ( ss != sss) {
10191019 debug ! ( "got %s" , ss) ;
10201020 debug ! ( "expected %s" , sss) ;
@@ -1077,7 +1077,7 @@ mod tests {
10771077 fn test_windows_paths( ) {
10781078 fn t( wp: & WindowsPath , s: & str ) {
10791079 let ss = wp. to_str( ) ;
1080- let sss = str :: from_slice ( s) ;
1080+ let sss = str :: to_owned ( s) ;
10811081 if ( ss != sss) {
10821082 debug!( "got %s" , ss) ;
10831083 debug!( "expected %s" , sss) ;
0 commit comments