Skip to content

Commit 78130e1

Browse files
eddyboisyn
authored andcommitted
tests: clean up the structopt usage slightly.
1 parent d9d9bd2 commit 78130e1

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/src/main.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,22 @@ use structopt::StructOpt;
1313
usage = "cargo compiletest [FLAGS] [FILTER]..."
1414
)]
1515
struct Opt {
16-
/// Automatically update stderr/stdout files
16+
/// Automatically update stderr/stdout files.
1717
#[structopt(long)]
1818
bless: bool,
1919

2020
/// The environment to compile to the SPIR-V tests.
21-
#[structopt(long)]
22-
target_env: Option<String>,
21+
#[structopt(long, default_value = "spv1.3")]
22+
target_env: String,
2323

24-
/// Only run tests that match these filters
24+
/// Only run tests that match these filters.
2525
#[structopt(name = "FILTER")]
2626
filters: Vec<String>,
2727
}
2828

2929
impl Opt {
3030
pub fn environments(&self) -> Vec<String> {
31-
match &self.target_env {
32-
Some(env) => env.split(',').map(String::from).collect(),
33-
None => vec!["spv1.3".into()],
34-
}
31+
self.target_env.split(',').map(String::from).collect()
3532
}
3633
}
3734

0 commit comments

Comments
 (0)