diff options
| author | Christoph Schulz <schulzcbs@gmail.com> | 2016-12-26 11:57:01 +0100 |
|---|---|---|
| committer | Christoph Schulz <schulzcbs@gmail.com> | 2016-12-26 11:57:01 +0100 |
| commit | 14994ac6b67cdaff1692f836e3495a75f4f7d71b (patch) | |
| tree | 43de0fcc64cd497e05da5e9db8e26bfbc4a21517 | |
| parent | a397add8a7d565a4d2a71a96dd21c543959abde0 (diff) | |
| download | rust-14994ac6b67cdaff1692f836e3495a75f4f7d71b.tar.gz rust-14994ac6b67cdaff1692f836e3495a75f4f7d71b.zip | |
Use cfg!() to get type checking everywhere.
| -rw-r--r-- | src/librustc_back/target/emscripten_base.rs | 12 |
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() + } } |
