about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristoph Schulz <schulzcbs@gmail.com>2016-12-26 11:57:01 +0100
committerChristoph Schulz <schulzcbs@gmail.com>2016-12-26 11:57:01 +0100
commit14994ac6b67cdaff1692f836e3495a75f4f7d71b (patch)
tree43de0fcc64cd497e05da5e9db8e26bfbc4a21517
parenta397add8a7d565a4d2a71a96dd21c543959abde0 (diff)
downloadrust-14994ac6b67cdaff1692f836e3495a75f4f7d71b.tar.gz
rust-14994ac6b67cdaff1692f836e3495a75f4f7d71b.zip
Use cfg!() to get type checking everywhere.
-rw-r--r--src/librustc_back/target/emscripten_base.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/librustc_back/target/emscripten_base.rs b/src/librustc_back/target/emscripten_base.rs
index 0c800271d04..bacada3f5ab 100644
--- a/src/librustc_back/target/emscripten_base.rs
+++ b/src/librustc_back/target/emscripten_base.rs
@@ -8,12 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[cfg(not(windows))]
 pub fn cmd(name: &str) -> String {
-    name.to_string()
-}
-
-#[cfg(windows)]
-pub fn cmd(name: &str) -> String {
-    [name, ".bat"].concat()
+    if cfg!(windows) {
+        format!("{}.bat", name)
+    } else {
+        name.to_string()
+    }
 }