From 9ed76b7a56a082d962db296ce83aa184927f7ffb Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 5 Jan 2025 02:44:29 +0000 Subject: [PATCH] More combinator cleanup (#17148) # Objective Cleanup some more awkward combinator chains. --- crates/bevy_diagnostic/src/diagnostic.rs | 3 +-- tools/build-templated-pages/src/examples.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/bevy_diagnostic/src/diagnostic.rs b/crates/bevy_diagnostic/src/diagnostic.rs index c9fbe5d600..56c1788661 100644 --- a/crates/bevy_diagnostic/src/diagnostic.rs +++ b/crates/bevy_diagnostic/src/diagnostic.rs @@ -351,8 +351,7 @@ impl<'w, 's> Diagnostics<'w, 's> { if self .store .get(path) - .filter(|diagnostic| diagnostic.is_enabled) - .is_some() + .is_some_and(|diagnostic| diagnostic.is_enabled) { let measurement = DiagnosticMeasurement { time: Instant::now(), diff --git a/tools/build-templated-pages/src/examples.rs b/tools/build-templated-pages/src/examples.rs index 9e1978a58b..b3329018db 100644 --- a/tools/build-templated-pages/src/examples.rs +++ b/tools/build-templated-pages/src/examples.rs @@ -64,8 +64,7 @@ fn parse_examples(panic_on_missing: bool) -> Vec { .get(&technical_name) .and_then(|metadata| metadata.get("hidden")) .and_then(Item::as_bool) - .and_then(|hidden| hidden.then_some(())) - .is_some() + .unwrap_or(false) { return None; }