Skip to content

Commit

Permalink
don't convert results to options just for matching (clippy::if_let_so…
Browse files Browse the repository at this point in the history
…me_result)
  • Loading branch information
matthiaskrgr committed Mar 21, 2020
1 parent 98803c1 commit 54e103b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustc_target/spec/apple_base.rs
Expand Up @@ -57,7 +57,7 @@ pub fn macos_link_env_remove() -> Vec<String> {
let mut env_remove = Vec::with_capacity(2);
// Remove the `SDKROOT` environment variable if it's clearly set for the wrong platform, which
// may occur when we're linking a custom build script while targeting iOS for example.
if let Some(sdkroot) = env::var("SDKROOT").ok() {
if let Ok(sdkroot) = env::var("SDKROOT") {
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("iPhoneSimulator.platform") {
env_remove.push("SDKROOT".to_string())
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_target/spec/apple_sdk_base.rs
Expand Up @@ -43,7 +43,7 @@ pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> {
// to allow the SDK path to be set. (For clang, xcrun sets
// SDKROOT; for rustc, the user or build system can set it, or we
// can fall back to checking for xcrun on PATH.)
if let Some(sdkroot) = env::var("SDKROOT").ok() {
if let Ok(sdkroot) = env::var("SDKROOT") {
let p = Path::new(&sdkroot);
match sdk_name {
// Ignore `SDKROOT` if it's clearly set for the wrong platform.
Expand Down

0 comments on commit 54e103b

Please sign in to comment.