File tree 3 files changed +0
-19
lines changed
3 files changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,6 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
179
179
str:: from_utf8_slice_opt ( self . as_vec ( ) )
180
180
}
181
181
182
- /// Converts the Path into an owned string, if possible
183
- fn into_str ( self ) -> Option < ~str > ;
184
-
185
182
/// Returns the path as a byte vector
186
183
fn as_vec < ' a > ( & ' a self ) -> & ' a [ u8 ] ;
187
184
Original file line number Diff line number Diff line change @@ -178,10 +178,6 @@ impl GenericPath for Path {
178
178
self . repr
179
179
}
180
180
181
- fn into_str ( self ) -> Option < ~str > {
182
- str:: from_utf8_owned_opt ( self . repr )
183
- }
184
-
185
181
fn dirname < ' a > ( & ' a self ) -> & ' a [ u8 ] {
186
182
match self . sepidx {
187
183
None if bytes ! ( ".." ) == self . repr => self . repr . as_slice ( ) ,
@@ -614,12 +610,9 @@ mod tests {
614
610
assert_eq ! ( Path :: new( b!( "foo/bar" ) ) . into_vec( ) , b!( "foo/bar" ) . to_owned( ) ) ;
615
611
assert_eq ! ( Path :: new( b!( "/foo/../../bar" ) ) . into_vec( ) ,
616
612
b!( "/bar" ) . to_owned( ) ) ;
617
- assert_eq ! ( Path :: new( "foo/bar" ) . into_str( ) , Some ( ~"foo/bar"));
618
- assert_eq!(Path::new(" /foo/../../bar").into_str(), Some(~" /bar"));
619
613
620
614
let p = Path :: new ( b ! ( "foo/bar" , 0x80 ) ) ;
621
615
assert_eq ! ( p. as_str( ) , None ) ;
622
- assert_eq!(Path::new(b!(" foo", 0xff, " /bar")).into_str(), None);
623
616
}
624
617
625
618
#[ test]
Original file line number Diff line number Diff line change @@ -327,13 +327,6 @@ impl GenericPath for Path {
327
327
Some ( self . repr . as_slice ( ) )
328
328
}
329
329
330
- /// See `GenericPath::into_str` for info.
331
- /// Always returns a `Some` value.
332
- #[ inline]
333
- fn into_str ( self ) -> Option < ~str > {
334
- Some ( self . repr )
335
- }
336
-
337
330
#[ inline]
338
331
fn as_vec < ' a > ( & ' a self ) -> & ' a [ u8 ] {
339
332
self . repr . as_bytes ( )
@@ -1260,8 +1253,6 @@ mod tests {
1260
1253
assert_eq ! ( Path :: new( b!( "foo\\ bar" ) ) . into_vec( ) , b!( "foo\\ bar" ) . to_owned( ) ) ;
1261
1254
assert_eq ! ( Path :: new( b!( "\\ foo\\ ..\\ ..\\ bar" ) ) . into_vec( ) ,
1262
1255
b!( "\\ bar" ) . to_owned( ) ) ;
1263
- assert_eq ! ( Path :: new( "foo\\ bar" ) . into_str( ) , Some ( ~"foo\\ bar"));
1264
- assert_eq!(Path::new("\\ foo\\ ..\\ ..\\ bar" ) . into_str( ) , Some ( ~"\\ bar"));
1265
1256
1266
1257
t ! ( s: Path :: new( "\\ \\ a" ) , "\\ a" ) ;
1267
1258
t ! ( s: Path :: new( "\\ \\ a\\ " ) , "\\ a" ) ;
You can’t perform that action at this time.
0 commit comments