Skip to content

Commit

Permalink
Reuse std::env::consts::EXE_SUFFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Mar 16, 2019
1 parent 7d09f17 commit cd570b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions tests/testsuite/support/install.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::env::consts::EXE_SUFFIX;
use std::path::{Path, PathBuf};

use crate::support::paths;
Expand All @@ -23,9 +24,5 @@ pub fn cargo_home() -> PathBuf {
}

pub fn exe(name: &str) -> String {
if cfg!(windows) {
format!("{}.exe", name)
} else {
name.to_string()
}
format!("{}{}", name, EXE_SUFFIX)
}
2 changes: 1 addition & 1 deletion tests/testsuite/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ fn substitute_macros(input: &str) -> String {
("[UNPACKING]", " Unpacking"),
("[SUMMARY]", " Summary"),
("[FIXING]", " Fixing"),
("[EXE]", if cfg!(windows) { ".exe" } else { "" }),
("[EXE]", env::consts::EXE_SUFFIX),
];
let mut result = input.to_owned();
for &(pat, subst) in &macros {
Expand Down

0 comments on commit cd570b3

Please sign in to comment.