From ae116a10e422ffba392791f9241c4132205e3689 Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jackpot51@gmail.com> Date: Wed, 2 May 2018 21:26:22 -0600 Subject: [PATCH] Fixes for Redox Path handling --- src/libstd/path.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 207de99a7bfa..4411026811d7 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -328,11 +328,6 @@ unsafe fn u8_slice_as_os_str(s: &[u8]) -> &OsStr { &*(s as *const [u8] as *const OsStr) } -// Detect scheme on Redox -fn has_redox_scheme(s: &[u8]) -> bool { - cfg!(target_os = "redox") && s.split(|b| *b == b'/').next().unwrap_or(b"").contains(&b':') -} - //////////////////////////////////////////////////////////////////////////////// // Cross-platform, iterator-independent parsing //////////////////////////////////////////////////////////////////////////////// @@ -1811,12 +1806,7 @@ pub fn to_path_buf(&self) -> PathBuf { #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated)] pub fn is_absolute(&self) -> bool { - if cfg!(target_os = "redox") { - // FIXME: Allow Redox prefixes - self.has_root() || has_redox_scheme(self.as_u8_slice()) - } else { - self.has_root() && (cfg!(unix) || self.prefix().is_some()) - } + self.has_root() && (cfg!(unix) || self.prefix().is_some()) } /// Returns `true` if the `Path` is relative, i.e. not absolute. @@ -2221,8 +2211,7 @@ pub fn components(&self) -> Components { Components { path: self.as_u8_slice(), prefix, - has_physical_root: has_physical_root(self.as_u8_slice(), prefix) || - has_redox_scheme(self.as_u8_slice()), + has_physical_root: has_physical_root(self.as_u8_slice(), prefix), front: State::Prefix, back: State::Body, } -- GitLab