@@ -1079,12 +1079,9 @@ impl<'a> Builder<'a> {
1079
1079
}
1080
1080
}
1081
1081
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" ) ;
1088
1085
}
1089
1086
1090
1087
// Throughout the build Cargo can execute a number of build scripts
@@ -1230,11 +1227,8 @@ impl<'a> Builder<'a> {
1230
1227
// When we build Rust dylibs they're all intended for intermediate
1231
1228
// usage, so make sure we pass the -Cprefer-dynamic flag instead of
1232
1229
// 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" ) ;
1238
1232
}
1239
1233
1240
1234
Cargo {
@@ -1348,7 +1342,7 @@ impl Rustflags {
1348
1342
fn new ( target : & str , cmd : & mut Command ) -> Rustflags {
1349
1343
let mut ret = Rustflags ( String :: new ( ) ) ;
1350
1344
1351
- // Inherit `RUSTFLAGS` by default
1345
+ // Inherit `RUSTFLAGS` by default ...
1352
1346
ret. env ( "RUSTFLAGS" ) ;
1353
1347
1354
1348
// ... and also handle target-specific env RUSTFLAGS if they're
@@ -1358,7 +1352,7 @@ impl Rustflags {
1358
1352
ret. env ( & target_specific) ;
1359
1353
cmd. env_remove ( & target_specific) ;
1360
1354
1361
- return ret;
1355
+ ret
1362
1356
}
1363
1357
1364
1358
fn env ( & mut self , env : & str ) {
0 commit comments