Skip to content

Commit 9b34ef6

Browse files
committed
Stylistic changes
1 parent 1607871 commit 9b34ef6

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/bootstrap/builder.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,12 +1079,9 @@ impl<'a> Builder<'a> {
10791079
}
10801080
}
10811081

1082-
match mode {
1083-
Mode::Rustc | Mode::Codegen => {
1084-
rustflags.arg("-Zunstable-options");
1085-
rustflags.arg("-Wrustc::internal");
1086-
}
1087-
_ => {}
1082+
if let Mode::Rustc | Mode::Codegen = mode {
1083+
rustflags.arg("-Zunstable-options");
1084+
rustflags.arg("-Wrustc::internal");
10881085
}
10891086

10901087
// Throughout the build Cargo can execute a number of build scripts
@@ -1230,11 +1227,8 @@ impl<'a> Builder<'a> {
12301227
// When we build Rust dylibs they're all intended for intermediate
12311228
// usage, so make sure we pass the -Cprefer-dynamic flag instead of
12321229
// linking all deps statically into the dylib.
1233-
match mode {
1234-
Mode::Std | Mode::Rustc | Mode::Codegen => {
1235-
rustflags.arg("-Cprefer-dynamic");
1236-
}
1237-
_ => {}
1230+
if let Mode::Std | Mode::Rustc | Mode::Codegen = mode {
1231+
rustflags.arg("-Cprefer-dynamic");
12381232
}
12391233

12401234
Cargo {
@@ -1348,7 +1342,7 @@ impl Rustflags {
13481342
fn new(target: &str, cmd: &mut Command) -> Rustflags {
13491343
let mut ret = Rustflags(String::new());
13501344

1351-
// Inherit `RUSTFLAGS` by default
1345+
// Inherit `RUSTFLAGS` by default ...
13521346
ret.env("RUSTFLAGS");
13531347

13541348
// ... and also handle target-specific env RUSTFLAGS if they're
@@ -1358,7 +1352,7 @@ impl Rustflags {
13581352
ret.env(&target_specific);
13591353
cmd.env_remove(&target_specific);
13601354

1361-
return ret;
1355+
ret
13621356
}
13631357

13641358
fn env(&mut self, env: &str) {

0 commit comments

Comments
 (0)