Skip to content

Commit 6dc763e

Browse files
committed
Fix nits
1 parent 691f645 commit 6dc763e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/librustc_target/spec/apple_base.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,24 @@ pub fn macos_llvm_target(arch: &str) -> String {
5454

5555
pub fn sysroot(sdk: &str) -> Result<String, String> {
5656
let actual_sdk_path = sdk_path(sdk)?;
57-
// Like Clang, allow the SDKROOT environment variable used by Xcode to define the sysroot
57+
// Like Clang, allow the `SDKROOT` environment variable used by Xcode to define the sysroot.
5858
if let Some(sdk_root) = env::var("SDKROOT").ok() {
5959
let sdk_root_p = Path::new(&sdk_root);
60-
// Ignore SDKROOT if it's not a valid path
60+
// Ignore `SDKROOT` if it's not a valid path.
6161
if !sdk_root_p.is_absolute() || sdk_root_p == Path::new("/") || !sdk_root_p.exists() {
6262
return Ok(actual_sdk_path);
6363
}
64-
// Ignore SDKROOT if it's clearly set for the wrong platform, which may occur when we're
65-
// compiling a custom build script while targeting iOS for example
66-
match sdk {
64+
// Ignore `SDKROOT` if it's clearly set for the wrong platform, which may occur when we're
65+
// compiling a custom build script while targeting iOS for example.
66+
return Ok(match sdk {
6767
"iphoneos" if sdk_root.contains("iPhoneSimulator.platform")
68-
|| sdk_root.contains("MacOSX.platform") => return Ok(actual_sdk_path),
68+
|| sdk_root.contains("MacOSX.platform") => actual_sdk_path,
6969
"iphonesimulator" if sdk_root.contains("iPhoneOS.platform")
70-
|| sdk_root.contains("MacOSX.platform") => return Ok(actual_sdk_path),
70+
|| sdk_root.contains("MacOSX.platform") => actual_sdk_path,
7171
"macosx" | "macosx10.15" if sdk_root.contains("iPhoneOS.platform")
72-
|| sdk_root.contains("iPhoneSimulator.platform") => return Ok(actual_sdk_path),
73-
_ => return Ok(sdk_root),
74-
}
72+
|| sdk_root.contains("iPhoneSimulator.platform") => actual_sdk_path,
73+
_ => sdk_root,
74+
})
7575
}
7676
Ok(actual_sdk_path)
7777
}

0 commit comments

Comments
 (0)