Skip to content

Commit 0dab78b

Browse files
committed
unify "test", "bench", "example" and "bin" into one branch
1 parent 32a0069 commit 0dab78b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,8 @@ pub fn main() {
146146
if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args), &dep_path, &sys_root) {
147147
std::process::exit(code);
148148
}
149-
} else if first == "bin" {
150-
if let Err(code) = process(vec!["--bin".to_owned(), target.name].into_iter().chain(args), &dep_path, &sys_root) {
151-
std::process::exit(code);
152-
}
153-
} else if first == "example" {
154-
if let Err(code) = process(vec!["--example".to_owned(), target.name].into_iter().chain(args), &dep_path, &sys_root) {
149+
} else if ["bin", "example", "test", "bench"].contains(&&**first) {
150+
if let Err(code) = process(vec![format!("--{}", first), target.name].into_iter().chain(args), &dep_path, &sys_root) {
155151
std::process::exit(code);
156152
}
157153
}

0 commit comments

Comments
 (0)