]> git.lizzy.rs Git - rust.git/commitdiff
don't convert results to options just for matching (clippy::if_let_some_result)
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 21 Mar 2020 11:50:22 +0000 (12:50 +0100)
committerMatthias Krüger <matthias.krueger@famsik.de>
Sat, 21 Mar 2020 14:24:48 +0000 (15:24 +0100)
src/librustc_target/spec/apple_base.rs
src/librustc_target/spec/apple_sdk_base.rs

index d116ddf952aaae3efbd5fa9e83e915efec83fca2..4ad65569e6a8a9ce93a0dd135c5aaf2b202848ba 100644 (file)
@@ -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())
         }
index 513754352fbfbbad86aebf4ab9a48dfce4c2ae28..03e0c55282e4d1f232a4810656e09b2f65d869a2 100644 (file)
@@ -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.