about summary refs log tree commit diff
path: root/src/librustc_target/spec
diff options
context:
space:
mode:
authorAleksi Juvani <aleksi@aleksijuvani.com>2019-09-07 19:04:59 +0300
committerAleksi Juvani <aleksi@aleksijuvani.com>2019-09-07 19:04:59 +0300
commit6dc763eed59295d0907a2780d66d4adf6f41a644 (patch)
treef1c55d20dc25b523a6f42136a2b30531f508c784 /src/librustc_target/spec
parent691f645ecd38d346fb047bbcb148694bd82c6a92 (diff)
downloadrust-6dc763eed59295d0907a2780d66d4adf6f41a644.tar.gz
rust-6dc763eed59295d0907a2780d66d4adf6f41a644.zip
Fix nits
Diffstat (limited to 'src/librustc_target/spec')
-rw-r--r--src/librustc_target/spec/apple_base.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc_target/spec/apple_base.rs b/src/librustc_target/spec/apple_base.rs
index aa5080aaaf6..297e64d4aeb 100644
--- a/src/librustc_target/spec/apple_base.rs
+++ b/src/librustc_target/spec/apple_base.rs
@@ -54,24 +54,24 @@ pub fn macos_llvm_target(arch: &str) -> String {
 
 pub fn sysroot(sdk: &str) -> Result<String, String> {
     let actual_sdk_path = sdk_path(sdk)?;
-    // Like Clang, allow the SDKROOT environment variable used by Xcode to define the sysroot
+    // Like Clang, allow the `SDKROOT` environment variable used by Xcode to define the sysroot.
     if let Some(sdk_root) = env::var("SDKROOT").ok() {
         let sdk_root_p = Path::new(&sdk_root);
-        // Ignore SDKROOT if it's not a valid path
+        // Ignore `SDKROOT` if it's not a valid path.
         if !sdk_root_p.is_absolute() || sdk_root_p == Path::new("/") || !sdk_root_p.exists() {
             return Ok(actual_sdk_path);
         }
-        // Ignore SDKROOT if it's clearly set for the wrong platform, which may occur when we're
-        // compiling a custom build script while targeting iOS for example
-        match sdk {
+        // Ignore `SDKROOT` if it's clearly set for the wrong platform, which may occur when we're
+        // compiling a custom build script while targeting iOS for example.
+        return Ok(match sdk {
             "iphoneos" if sdk_root.contains("iPhoneSimulator.platform")
-                || sdk_root.contains("MacOSX.platform") => return Ok(actual_sdk_path),
+                || sdk_root.contains("MacOSX.platform") => actual_sdk_path,
             "iphonesimulator" if sdk_root.contains("iPhoneOS.platform")
-                || sdk_root.contains("MacOSX.platform") => return Ok(actual_sdk_path),
+                || sdk_root.contains("MacOSX.platform") => actual_sdk_path,
             "macosx" | "macosx10.15" if sdk_root.contains("iPhoneOS.platform")
-                || sdk_root.contains("iPhoneSimulator.platform") => return Ok(actual_sdk_path),
-            _ => return Ok(sdk_root),
-        }
+                || sdk_root.contains("iPhoneSimulator.platform") => actual_sdk_path,
+            _ => sdk_root,
+        })
     }
     Ok(actual_sdk_path)
 }