From 120e1f9809d716c4f5fb28b043a6b8d07f1f9bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 11 Jan 2024 10:36:37 +0100 Subject: [PATCH] refactor(build.rs): replace `matches!` with `is_some_and` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- hermit/build.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hermit/build.rs b/hermit/build.rs index 21d587159..514b3b3e3 100644 --- a/hermit/build.rs +++ b/hermit/build.rs @@ -1,5 +1,4 @@ use std::env; -use std::ffi::OsStr; use std::path::{Path, PathBuf}; use std::process::Command; use std::str; @@ -8,12 +7,10 @@ use flate2::read::GzDecoder; use tar::Archive; fn main() { - // TODO: Replace with is_some_with once stabilized - // https://github.com/rust-lang/rust/issues/93050 let targets_hermit = - matches!(env::var_os("CARGO_CFG_TARGET_OS"), Some(os) if os == OsStr::new("hermit")); + env::var_os("CARGO_CFG_TARGET_OS").is_some_and(|target_os| target_os == "hermit"); let runs_clippy = - matches!(env::var_os("CARGO_CFG_FEATURE"), Some(os) if os == OsStr::new("cargo-clippy")); + env::var_os("CARGO_CFG_FEATURE").is_some_and(|feature| feature == "cargo-clippy"); let is_docs_rs = env::var_os("DOCS_RS").is_some(); if !targets_hermit || runs_clippy || is_docs_rs { return;