@@ -477,7 +477,7 @@ impl GenericPath for PosixPath {
477
477
fn with_filestem ( & self , s : & str ) -> PosixPath {
478
478
match self . filetype ( ) {
479
479
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)
481
481
}
482
482
}
483
483
@@ -488,7 +488,7 @@ impl GenericPath for PosixPath {
488
488
Some ( ref s) => self . with_filename ( * s)
489
489
}
490
490
} else {
491
- let t = ~". " + str:: from_slice ( t) ;
491
+ let t = ~". " + str:: to_owned ( t) ;
492
492
match self . filestem ( ) {
493
493
None => self . with_filename ( t) ,
494
494
Some ( ref s) => self . with_filename ( * s + t)
@@ -621,7 +621,7 @@ impl GenericPath for WindowsPath {
621
621
None => {
622
622
host = None ;
623
623
device = None ;
624
- rest = str:: from_slice ( s) ;
624
+ rest = str:: to_owned ( s) ;
625
625
}
626
626
}
627
627
}
@@ -694,7 +694,7 @@ impl GenericPath for WindowsPath {
694
694
fn with_filestem ( & self , s : & str ) -> WindowsPath {
695
695
match self . filetype ( ) {
696
696
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)
698
698
}
699
699
}
700
700
@@ -705,7 +705,7 @@ impl GenericPath for WindowsPath {
705
705
Some ( ref s) => self . with_filename ( * s)
706
706
}
707
707
} else {
708
- let t = ~". " + str:: from_slice ( t) ;
708
+ let t = ~". " + str:: to_owned ( t) ;
709
709
match self . filestem ( ) {
710
710
None => self . with_filename ( t) ,
711
711
Some ( ref s) =>
@@ -956,7 +956,7 @@ mod tests {
956
956
fn test_posix_paths() {
957
957
fn t(wp: &PosixPath, s: &str) {
958
958
let ss = wp.to_str();
959
- let sss = str::from_slice (s);
959
+ let sss = str::to_owned (s);
960
960
if (ss != sss) {
961
961
debug!(" got %s", ss);
962
962
debug!(" expected %s", sss);
@@ -1014,7 +1014,7 @@ mod tests {
1014
1014
fn test_normalize ( ) {
1015
1015
fn t ( wp : & PosixPath , s : & str ) {
1016
1016
let ss = wp. to_str ( ) ;
1017
- let sss = str:: from_slice ( s) ;
1017
+ let sss = str:: to_owned ( s) ;
1018
1018
if ( ss != sss) {
1019
1019
debug ! ( "got %s" , ss) ;
1020
1020
debug ! ( "expected %s" , sss) ;
@@ -1077,7 +1077,7 @@ mod tests {
1077
1077
fn test_windows_paths( ) {
1078
1078
fn t( wp: & WindowsPath , s: & str ) {
1079
1079
let ss = wp. to_str( ) ;
1080
- let sss = str :: from_slice ( s) ;
1080
+ let sss = str :: to_owned ( s) ;
1081
1081
if ( ss != sss) {
1082
1082
debug!( "got %s" , ss) ;
1083
1083
debug!( "expected %s" , sss) ;
0 commit comments