Skip to content

Commit 14994ac

Browse files
committed
Use cfg!() to get type checking everywhere.
1 parent a397add commit 14994ac

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/librustc_back/target/emscripten_base.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[cfg(not(windows))]
1211
pub fn cmd(name: &str) -> String {
13-
name.to_string()
14-
}
15-
16-
#[cfg(windows)]
17-
pub fn cmd(name: &str) -> String {
18-
[name, ".bat"].concat()
12+
if cfg!(windows) {
13+
format!("{}.bat", name)
14+
} else {
15+
name.to_string()
16+
}
1917
}

0 commit comments

Comments
 (0)