Skip to content

Commit fbb1fd1

Browse files
committed
Fixes for Redox Path handling
1 parent 8b18ef9 commit fbb1fd1

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/libstd/path.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,6 @@ unsafe fn u8_slice_as_os_str(s: &[u8]) -> &OsStr {
327327
&*(s as *const [u8] as *const OsStr)
328328
}
329329

330-
// Detect scheme on Redox
331-
fn has_redox_scheme(s: &[u8]) -> bool {
332-
cfg!(target_os = "redox") && s.split(|b| *b == b'/').next().unwrap_or(b"").contains(&b':')
333-
}
334-
335330
////////////////////////////////////////////////////////////////////////////////
336331
// Cross-platform, iterator-independent parsing
337332
////////////////////////////////////////////////////////////////////////////////
@@ -1798,12 +1793,7 @@ impl Path {
17981793
#[stable(feature = "rust1", since = "1.0.0")]
17991794
#[allow(deprecated)]
18001795
pub fn is_absolute(&self) -> bool {
1801-
if cfg!(target_os = "redox") {
1802-
// FIXME: Allow Redox prefixes
1803-
self.has_root() || has_redox_scheme(self.as_u8_slice())
1804-
} else {
1805-
self.has_root() && (cfg!(unix) || self.prefix().is_some())
1806-
}
1796+
self.has_root() && (cfg!(unix) || self.prefix().is_some())
18071797
}
18081798

18091799
/// Returns `true` if the `Path` is relative, i.e. not absolute.
@@ -2206,8 +2196,7 @@ impl Path {
22062196
Components {
22072197
path: self.as_u8_slice(),
22082198
prefix,
2209-
has_physical_root: has_physical_root(self.as_u8_slice(), prefix) ||
2210-
has_redox_scheme(self.as_u8_slice()),
2199+
has_physical_root: has_physical_root(self.as_u8_slice(), prefix),
22112200
front: State::Prefix,
22122201
back: State::Body,
22132202
}

0 commit comments

Comments
 (0)