diff --git a/core/src/animation/keyframes.rs b/core/src/animation/keyframes.rs index 5aa3bee2d..c66341e2c 100644 --- a/core/src/animation/keyframes.rs +++ b/core/src/animation/keyframes.rs @@ -102,6 +102,7 @@ impl KeyFrames { Self { state, frames: keyframes.into_boxed_slice() } } + #[allow(clippy::type_complexity)] /// Converts the `KeyFrames` into a `LerpFnState` that can be used for /// animations. pub fn into_lerp_fn_state( diff --git a/core/src/events/focus_mgr.rs b/core/src/events/focus_mgr.rs index 501c255cd..b993f60a9 100644 --- a/core/src/events/focus_mgr.rs +++ b/core/src/events/focus_mgr.rs @@ -149,7 +149,7 @@ impl FocusManager { .find(|request| { request .as_ref() - .map_or(true, |id| !id.is_dropped(arena)) + .is_none_or(|id| !id.is_dropped(arena)) }); let focusing = next_focus diff --git a/core/src/window.rs b/core/src/window.rs index 0f93528b2..213e9fe71 100644 --- a/core/src/window.rs +++ b/core/src/window.rs @@ -358,7 +358,7 @@ impl Window { let tree = self.tree_mut(); let drop_conditional = wid .query_ref::(tree) - .map_or(true, |d| !d.keep_alive); + .is_none_or(|d| !d.keep_alive); let parent_dropped = parent .as_ref() .is_some_and(|p| p.ancestors(tree).any(|w| w.is_dropped(tree))); diff --git a/macros/src/child_template.rs b/macros/src/child_template.rs index e938afba1..d68f6d106 100644 --- a/macros/src/child_template.rs +++ b/macros/src/child_template.rs @@ -234,12 +234,11 @@ fn option_type_extract(ty: &syn::Type) -> Option<&syn::Type> { .filter(|s| s.ident == "Option") .filter(|_| { // the second last can be None or "option" - iter.next().map_or(true, |s| { + iter.next().is_none_or(|s| { match_ident(s, "option") && iter .next() - // the second last can be None or "option" or "core" - .map_or(true, |s| match_ident(s, "std") || match_ident(s, "core")) + .is_none_or(|s| match_ident(s, "std") || match_ident(s, "core")) }) }) .and_then(|s| match &s.arguments { diff --git a/macros/src/simple_declare_attr.rs b/macros/src/simple_declare_attr.rs index 59e039767..246efb1e0 100644 --- a/macros/src/simple_declare_attr.rs +++ b/macros/src/simple_declare_attr.rs @@ -155,7 +155,7 @@ impl<'a> DeclareField<'a> { self .attr .as_ref() - .map_or(true, |attr| attr.skip.is_none()) + .is_none_or(|attr| attr.skip.is_none()) } pub fn is_strict(&self) -> bool { @@ -189,7 +189,7 @@ impl<'a> DeclareField<'a> { self .attr .as_ref() - .map_or(true, |attr| attr.custom.is_none() && attr.skip.is_none()) + .is_none_or(|attr| attr.custom.is_none() && attr.skip.is_none()) } pub fn doc_attr(&self) -> Option<&Attribute> { diff --git a/painter/src/text/shaper.rs b/painter/src/text/shaper.rs index ab4a84e06..df7a4625c 100644 --- a/painter/src/text/shaper.rs +++ b/painter/src/text/shaper.rs @@ -144,7 +144,7 @@ fn collect_miss_part<'a>( last_miss_cluster = Some(glyph.cluster); } else if last_miss_cluster .as_ref() - .map_or(true, |cluster| *cluster != glyph.cluster) + .is_none_or(|cluster| *cluster != glyph.cluster) && miss_start.is_some() { miss_parts.push((miss_start.take().unwrap(), idx, helper.clone())); diff --git a/painter/src/text/typography_store.rs b/painter/src/text/typography_store.rs index d3297cd71..331994dd4 100644 --- a/painter/src/text/typography_store.rs +++ b/painter/src/text/typography_store.rs @@ -232,7 +232,7 @@ impl VisualGlyphs { let order_info = &self.order_info.paras[para]; let locator = RangeLocator::from_unorder_ranges(order_info.runs.iter()); let dst_run = locator.range_index(cluster); - let is_ltr = dst_run.map_or(true, |run| order_info.levels[order_info.runs[run].start].is_ltr()); + let is_ltr = dst_run.is_none_or(|run| order_info.levels[order_info.runs[run].start].is_ltr()); let is_layout_before = |glyph_cluster: usize| { if dst_run.is_none() { return true;