Use cfg!() to get type checking everywhere.

This commit is contained in:
Christoph Schulz 2016-12-26 11:57:01 +01:00
parent a397add8a7
commit 14994ac6b6

View File

@ -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()
}
}