about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2025-04-03 21:31:02 +0200
committerPhilipp Krones <hello@philkrones.com>2025-04-03 21:31:02 +0200
commitab7e5259293dc1ee5828532982d037bed63f507f (patch)
tree93fa8f70c113ecb7a42898ff60d8a9389824b8ce /src
parent978ed960eb8bc8da60d6b90cdcc3887c560d257f (diff)
parent41d7e456c4c422f3e186adaeffdb732120228484 (diff)
downloadrust-ab7e5259293dc1ee5828532982d037bed63f507f.tar.gz
rust-ab7e5259293dc1ee5828532982d037bed63f507f.zip
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'src')
-rw-r--r--src/driver.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/driver.rs b/src/driver.rs
index e4092bcd105..c6b3c06baa4 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -207,12 +207,12 @@ pub fn main() {
             // Beside checking for existence of `--sysroot` on the command line, we need to
             // check for the arg files that are prefixed with @ as well to be consistent with rustc
             for arg in args.iter() {
-                if let Some(arg_file_path) = arg.strip_prefix('@') {
-                    if let Ok(arg_file) = read_to_string(arg_file_path) {
-                        let split_arg_file: Vec<String> = arg_file.lines().map(ToString::to_string).collect();
-                        if has_arg(&split_arg_file, "--sysroot") {
-                            return true;
-                        }
+                if let Some(arg_file_path) = arg.strip_prefix('@')
+                    && let Ok(arg_file) = read_to_string(arg_file_path)
+                {
+                    let split_arg_file: Vec<String> = arg_file.lines().map(ToString::to_string).collect();
+                    if has_arg(&split_arg_file, "--sysroot") {
+                        return true;
                     }
                 }
             }
@@ -221,10 +221,10 @@ pub fn main() {
 
         let sys_root_env = std::env::var("SYSROOT").ok();
         let pass_sysroot_env_if_given = |args: &mut Vec<String>, sys_root_env| {
-            if let Some(sys_root) = sys_root_env {
-                if !has_sysroot_arg(args) {
-                    args.extend(vec!["--sysroot".into(), sys_root]);
-                }
+            if let Some(sys_root) = sys_root_env
+                && !has_sysroot_arg(args)
+            {
+                args.extend(vec!["--sysroot".into(), sys_root]);
             }
         };