Skip to content

Commit de166d5

Browse files
committed
refactor: shrink program declaration
1 parent 0f735b2 commit de166d5

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

bevy_lint/tests/ui.rs

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,23 @@ fn config() -> Config {
1111
// Make this an empty string, because `bevy_lint_driver` does not currently support the
1212
// `--version` flag, which is required to auto-discover the host.
1313
host: Some(String::new()),
14-
program: {
15-
let mut p = CommandBuilder::rustc();
16-
17-
// Switch from raw `rustc` calls to `rustup run TOOLCHAIN bevy_lint_driver`.
18-
p.program = PathBuf::from("rustup");
19-
20-
p.args = [
21-
"run",
22-
"nightly-2024-08-21",
23-
"../target/debug/bevy_lint_driver",
24-
"rustc",
25-
"--error-format=json",
14+
program: CommandBuilder {
15+
program: "rustup".into(),
16+
args: vec![
17+
"run".into(),
18+
"nightly-2024-08-21".into(),
19+
"../target/debug/bevy_lint_driver".into(),
20+
"rustc".into(),
21+
"--error-format=json".into(),
2622
// This allows examples to `use bevy;`.
27-
"-L",
28-
"all=../target/debug/deps",
29-
"--extern=bevy",
30-
]
31-
.into_iter()
32-
.map(OsString::from)
33-
.collect();
34-
35-
p
23+
"-L".into(),
24+
"all=../target/debug/deps".into(),
25+
"--extern=bevy".into(),
26+
],
27+
out_dir_flag: Some("--out-dir".into()),
28+
input_file_flag: None,
29+
envs: Vec::new(),
30+
cfg_flag: Some("--print=cfg".into()),
3631
},
3732
out_dir: PathBuf::from("../target/ui"),
3833
..Config::rustc("tests/ui")

0 commit comments

Comments
 (0)