Skip to content

Commit 54e103b

Browse files
committed
don't convert results to options just for matching (clippy::if_let_some_result)
1 parent 98803c1 commit 54e103b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/librustc_target/spec/apple_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn macos_link_env_remove() -> Vec<String> {
5757
let mut env_remove = Vec::with_capacity(2);
5858
// Remove the `SDKROOT` environment variable if it's clearly set for the wrong platform, which
5959
// may occur when we're linking a custom build script while targeting iOS for example.
60-
if let Some(sdkroot) = env::var("SDKROOT").ok() {
60+
if let Ok(sdkroot) = env::var("SDKROOT") {
6161
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("iPhoneSimulator.platform") {
6262
env_remove.push("SDKROOT".to_string())
6363
}

src/librustc_target/spec/apple_sdk_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> {
4343
// to allow the SDK path to be set. (For clang, xcrun sets
4444
// SDKROOT; for rustc, the user or build system can set it, or we
4545
// can fall back to checking for xcrun on PATH.)
46-
if let Some(sdkroot) = env::var("SDKROOT").ok() {
46+
if let Ok(sdkroot) = env::var("SDKROOT") {
4747
let p = Path::new(&sdkroot);
4848
match sdk_name {
4949
// Ignore `SDKROOT` if it's clearly set for the wrong platform.

0 commit comments

Comments
 (0)