about summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
authorIan Douglas Scott <ian@iandouglasscott.com>2017-08-22 08:17:05 -0700
committerIan Douglas Scott <ian@iandouglasscott.com>2017-08-22 08:17:05 -0700
commitab48de88472f19596ba2a67ff4e8a8c1c4015989 (patch)
tree1d4d7d1dceb65ed732c0e580ffe5c6e8838b73c6 /src/libstd/path.rs
parente0f0fd08b5e823561848c9541ac432eb30b976bd (diff)
downloadrust-ab48de88472f19596ba2a67ff4e8a8c1c4015989.tar.gz
rust-ab48de88472f19596ba2a67ff4e8a8c1c4015989.zip
Use cfg! instead of #[cfg]
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 5757d447c54..32e1781c3c4 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -327,14 +327,7 @@ unsafe fn u8_slice_as_os_str(s: &[u8]) -> &OsStr {
 #[inline]
 #[allow(unused_variables)]
 fn has_scheme(s: &[u8]) -> bool {
-    #[cfg(target_os = "redox")]
-    {
-        s.split(|b| *b == b'/').next().unwrap_or(b"").contains(&b':')
-    }
-    #[cfg(not(target_os = "redox"))]
-    {
-        false
-    }
+    cfg!(target_os = "redox") && s.split(|b| *b == b'/').next().unwrap_or(b"").contains(&b':')
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1702,12 +1695,9 @@ impl Path {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[allow(deprecated)]
     pub fn is_absolute(&self) -> bool {
-        #[cfg(not(target_os = "redox"))]
-        {
+        if !cfg!(target_os = "redox") {
             self.has_root() && (cfg!(unix) || self.prefix().is_some())
-        }
-        #[cfg(target_os = "redox")]
-        {
+        } else {
             // FIXME: Allow Redox prefixes
             has_scheme(self.as_u8_slice())
         }