about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2019-09-10 09:10:24 -0700
committerAlex Crichton <alex@alexcrichton.com>2019-09-23 09:34:44 -0700
commit9b34ef643f82f14b7c94041af4b34788801c9983 (patch)
tree1e62c479e23795f93b7d6918929c96d1ec212532
parent160787129b757f364ce9ef44510845ec0c1c4410 (diff)
downloadrust-9b34ef643f82f14b7c94041af4b34788801c9983.tar.gz
rust-9b34ef643f82f14b7c94041af4b34788801c9983.zip
Stylistic changes
-rw-r--r--src/bootstrap/builder.rs20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 428926e106b..9046eded381 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1079,12 +1079,9 @@ impl<'a> Builder<'a> {
             }
         }
 
-        match mode {
-            Mode::Rustc | Mode::Codegen => {
-                rustflags.arg("-Zunstable-options");
-                rustflags.arg("-Wrustc::internal");
-            }
-            _ => {}
+        if let Mode::Rustc | Mode::Codegen = mode {
+            rustflags.arg("-Zunstable-options");
+            rustflags.arg("-Wrustc::internal");
         }
 
         // Throughout the build Cargo can execute a number of build scripts
@@ -1230,11 +1227,8 @@ impl<'a> Builder<'a> {
         // When we build Rust dylibs they're all intended for intermediate
         // usage, so make sure we pass the -Cprefer-dynamic flag instead of
         // linking all deps statically into the dylib.
-        match mode {
-            Mode::Std | Mode::Rustc | Mode::Codegen => {
-                rustflags.arg("-Cprefer-dynamic");
-            }
-            _ => {}
+        if let Mode::Std | Mode::Rustc | Mode::Codegen = mode {
+            rustflags.arg("-Cprefer-dynamic");
         }
 
         Cargo {
@@ -1348,7 +1342,7 @@ impl Rustflags {
     fn new(target: &str, cmd: &mut Command) -> Rustflags {
         let mut ret = Rustflags(String::new());
 
-        // Inherit `RUSTFLAGS` by default
+        // Inherit `RUSTFLAGS` by default ...
         ret.env("RUSTFLAGS");
 
         // ... and also handle target-specific env RUSTFLAGS if they're
@@ -1358,7 +1352,7 @@ impl Rustflags {
         ret.env(&target_specific);
         cmd.env_remove(&target_specific);
 
-        return ret;
+        ret
     }
 
     fn env(&mut self, env: &str) {