From b4b17b42f08302a38e92ee9c3e6925c17a7aada5 Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Thu, 21 Nov 2024 15:15:13 +0000 Subject: [PATCH] Make Clippy happy --- macro/src/type_utils.rs | 2 +- runtime/src/lib.rs | 2 +- test-fuzz/tests/integration/ci.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/macro/src/type_utils.rs b/macro/src/type_utils.rs index de439f49..dacf203e 100644 --- a/macro/src/type_utils.rs +++ b/macro/src/type_utils.rs @@ -127,7 +127,7 @@ impl VisitMut for ExpandSelfVisitor<'_> { .path .segments .first() - .map_or(false, |segment| segment.ident == "Self") + .is_some_and(|segment| segment.ident == "Self") { let segments = path.path.segments.iter().skip(1).collect::>(); let self_ty = self.self_ty; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index bede414a..f7770f93 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -144,7 +144,7 @@ pub fn write_enabled() -> bool { #[must_use] fn enabled(opt: &str) -> bool { let key = "TEST_FUZZ".to_owned() + if opt.is_empty() { "" } else { "_" } + opt; - env::var(key).map_or(false, |value| value != "0") + env::var(key).is_ok_and(|value| value != "0") } pub fn write_impl_generic_args(args: &[&str]) { diff --git a/test-fuzz/tests/integration/ci.rs b/test-fuzz/tests/integration/ci.rs index 0b20a42b..3a8c14d2 100644 --- a/test-fuzz/tests/integration/ci.rs +++ b/test-fuzz/tests/integration/ci.rs @@ -132,5 +132,5 @@ fn unmaintained() { #[must_use] pub fn enabled(key: &str) -> bool { - var(key).map_or(false, |value| value != "0") + var(key).is_ok_and(|value| value != "0") }