From f3d7e034725c932d87ddab036472514912077cec Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sat, 21 Dec 2019 17:04:41 +0000 Subject: [PATCH] use Result::map_or for bootstrap --- src/bootstrap/util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index 6824b7a58c480..085742b011c84 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -270,9 +270,9 @@ pub enum CiEnv { impl CiEnv { /// Obtains the current CI environment. pub fn current() -> CiEnv { - if env::var("TF_BUILD").ok().map_or(false, |e| &*e == "True") { + if env::var("TF_BUILD").map_or(false, |e| e == "True") { CiEnv::AzurePipelines - } else if env::var("GITHUB_ACTIONS").ok().map_or(false, |e| &*e == "true") { + } else if env::var("GITHUB_ACTIONS").map_or(false, |e| e == "true") { CiEnv::GitHubActions } else { CiEnv::None