From abf08329bbcc0a3d7c91c3e5c98c458c77a968cc Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 24 Nov 2023 08:49:37 -0800 Subject: [PATCH] Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)` --- scripts/rustc-clif.rs | 2 +- scripts/rustdoc-clif.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rustc-clif.rs b/scripts/rustc-clif.rs index 33d51bdddea..550f2051553 100644 --- a/scripts/rustc-clif.rs +++ b/scripts/rustc-clif.rs @@ -27,7 +27,7 @@ fn main() { args.push(codegen_backend_arg); } if !passed_args.iter().any(|arg| { - arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true) + arg == "--sysroot" || arg.to_str().is_some_and(|s| s.starts_with("--sysroot=")) }) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); diff --git a/scripts/rustdoc-clif.rs b/scripts/rustdoc-clif.rs index 10582cc7bb3..f7d1bdbc4c6 100644 --- a/scripts/rustdoc-clif.rs +++ b/scripts/rustdoc-clif.rs @@ -27,7 +27,7 @@ fn main() { args.push(codegen_backend_arg); } if !passed_args.iter().any(|arg| { - arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true) + arg == "--sysroot" || arg.to_str().is_some_and(|s| s.starts_with("--sysroot=")) }) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap()));