Use cfg!() to get type checking everywhere.
This commit is contained in:
parent
a397add8a7
commit
14994ac6b6
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user