Replace .map_or(false with Option::is_some_and (#33468)

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2024-09-16 12:03:52 +02:00 committed by GitHub
parent 236cae9ce5
commit 7df30f3788
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 165 additions and 171 deletions

View file

@ -868,7 +868,7 @@ impl Fragment {
node_address == self.node ||
self.inline_context
.as_ref()
.map_or(false, |ctx| ctx.contains_node(node_address))
.is_some_and(|ctx| ctx.contains_node(node_address))
}
/// Adds a style to the inline context for this fragment. If the inline context doesn't exist
@ -2750,9 +2750,7 @@ impl Fragment {
/// Returns true if this fragment has a transform applied that causes it to take up no space.
pub fn has_non_invertible_transform_or_zero_scale(&self) -> bool {
self.transform_matrix(&Rect::default())
.map_or(false, |matrix| {
!matrix.is_invertible() || matrix.m11 == 0. || matrix.m22 == 0.
})
.is_some_and(|matrix| !matrix.is_invertible() || matrix.m11 == 0. || matrix.m22 == 0.)
}
/// Returns true if this fragment establishes a new stacking context and false otherwise.