@@ -324,9 +324,7 @@ unsafe fn u8_slice_as_os_str(s: &[u8]) -> &OsStr {
324
324
}
325
325
326
326
// Detect scheme on Redox
327
- #[ inline]
328
- #[ allow( unused_variables) ]
329
- fn has_scheme ( s : & [ u8 ] ) -> bool {
327
+ fn has_redox_scheme ( s : & [ u8 ] ) -> bool {
330
328
cfg ! ( target_os = "redox" ) && s. split ( |b| * b == b'/' ) . next ( ) . unwrap_or ( b"" ) . contains ( & b':' )
331
329
}
332
330
@@ -612,9 +610,6 @@ pub struct Components<'a> {
612
610
// normalization, e.g. \\server\share == \\server\share\.
613
611
has_physical_root : bool ,
614
612
615
- // For Redox
616
- has_scheme : bool ,
617
-
618
613
// The iterator is double-ended, and these two states keep track of what has
619
614
// been produced from either end
620
615
front : State ,
@@ -735,7 +730,7 @@ impl<'a> Components<'a> {
735
730
736
731
/// Is the *original* path rooted?
737
732
fn has_root ( & self ) -> bool {
738
- if self . has_physical_root || self . has_scheme {
733
+ if self . has_physical_root {
739
734
return true ;
740
735
}
741
736
if let Some ( p) = self . prefix {
@@ -1699,7 +1694,7 @@ impl Path {
1699
1694
self . has_root ( ) && ( cfg ! ( unix) || self . prefix ( ) . is_some ( ) )
1700
1695
} else {
1701
1696
// FIXME: Allow Redox prefixes
1702
- has_scheme ( self . as_u8_slice ( ) )
1697
+ has_redox_scheme ( self . as_u8_slice ( ) )
1703
1698
}
1704
1699
}
1705
1700
@@ -2064,8 +2059,8 @@ impl Path {
2064
2059
Components {
2065
2060
path : self . as_u8_slice ( ) ,
2066
2061
prefix,
2067
- has_physical_root : has_physical_root ( self . as_u8_slice ( ) , prefix) ,
2068
- has_scheme : has_scheme ( self . as_u8_slice ( ) ) ,
2062
+ has_physical_root : has_physical_root ( self . as_u8_slice ( ) , prefix) ||
2063
+ has_redox_scheme ( self . as_u8_slice ( ) ) ,
2069
2064
front : State :: Prefix ,
2070
2065
back : State :: Body ,
2071
2066
}
0 commit comments