diff options
Diffstat (limited to 'components/layout_2020')
-rw-r--r-- | components/layout_2020/display_list/stacking_context.rs | 2 | ||||
-rw-r--r-- | components/layout_2020/flexbox/layout.rs | 2 | ||||
-rw-r--r-- | components/layout_2020/positioned.rs | 2 | ||||
-rw-r--r-- | components/layout_2020/table/mod.rs | 6 |
4 files changed, 4 insertions, 8 deletions
diff --git a/components/layout_2020/display_list/stacking_context.rs b/components/layout_2020/display_list/stacking_context.rs index fbebb7ecf43..2affc4702c1 100644 --- a/components/layout_2020/display_list/stacking_context.rs +++ b/components/layout_2020/display_list/stacking_context.rs @@ -98,7 +98,7 @@ impl DisplayList { /// but has to be unique to the entire scene. fn get_next_spatial_tree_item_key(&mut self) -> SpatialTreeItemKey { self.spatial_tree_count += 1; - let pipeline_tag = (self.wr.pipeline_id.0 as u64) << 32 | self.wr.pipeline_id.1 as u64; + let pipeline_tag = ((self.wr.pipeline_id.0 as u64) << 32) | self.wr.pipeline_id.1 as u64; SpatialTreeItemKey::new(pipeline_tag, self.spatial_tree_count) } diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs index c5cbb412496..99563d92f1b 100644 --- a/components/layout_2020/flexbox/layout.rs +++ b/components/layout_2020/flexbox/layout.rs @@ -2072,7 +2072,7 @@ impl FlexItem<'_> { (flex_axis == FlexAxis::Row && self.stretches()); let has_child_which_depends_on_block_constraints = fragments.iter().any(|fragment| { - fragment.base().map_or(false,|base| + fragment.base().is_some_and(|base| base.flags.contains( FragmentFlags::SIZE_DEPENDS_ON_BLOCK_CONSTRAINTS_AND_CAN_BE_CHILD_OF_FLEX_ITEM)) }); diff --git a/components/layout_2020/positioned.rs b/components/layout_2020/positioned.rs index 8767f042700..614dea8c882 100644 --- a/components/layout_2020/positioned.rs +++ b/components/layout_2020/positioned.rs @@ -302,7 +302,7 @@ impl PositioningContext { .is_empty() && self.for_nearest_positioned_ancestor .as_ref() - .map_or(true, |vector| vector.is_empty()) + .is_none_or(|vector| vector.is_empty()) } pub(crate) fn append(&mut self, other: Self) { diff --git a/components/layout_2020/table/mod.rs b/components/layout_2020/table/mod.rs index dfcf2b840ea..25c0decebad 100644 --- a/components/layout_2020/table/mod.rs +++ b/components/layout_2020/table/mod.rs @@ -176,11 +176,7 @@ impl Table { } fn resolve_first_cell(&self, coords: TableSlotCoordinates) -> Option<&TableSlotCell> { - let resolved_coords = match self.resolve_first_cell_coords(coords) { - Some(coords) => coords, - None => return None, - }; - + let resolved_coords = self.resolve_first_cell_coords(coords)?; let slot = self.get_slot(resolved_coords); match slot { Some(TableSlot::Cell(cell)) => Some(cell), |