Skip to content

Commit

Permalink
Auto merge of #6758 - dwijnand:reuse-std-env-consts-EXE_SUFFIX, r=ehuss
Browse files Browse the repository at this point in the history
Reuse std::env::consts::EXE_SUFFIX

None
  • Loading branch information
bors committed Mar 17, 2019
2 parents 7d09f17 + cd570b3 commit 8858383
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 8858383

Please sign in to comment.