diff options
author | eri <eri@inventati.org> | 2024-03-11 11:24:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 10:24:36 +0000 |
commit | a6e25d555beec2c454c03f9ca0f5c4047d538b2d (patch) | |
tree | 2bf5504d7b8f3733072d39c6a6858f14694a0ca3 /components/layout/display_list/builder.rs | |
parent | 7f1ef4c7fe7d68b08894eb0e944448505178f79d (diff) | |
download | servo-a6e25d555beec2c454c03f9ca0f5c4047d538b2d.tar.gz servo-a6e25d555beec2c454c03f9ca0f5c4047d538b2d.zip |
clippy: Fix warnings in `components/layout` (#31612)
* clippy: fix warnings in components/layout
* fix: formatting
Diffstat (limited to 'components/layout/display_list/builder.rs')
-rw-r--r-- | components/layout/display_list/builder.rs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs index d453fdfe8e8..6d070f3d525 100644 --- a/components/layout/display_list/builder.rs +++ b/components/layout/display_list/builder.rs @@ -8,6 +8,8 @@ //! list building, as the actual painting does not happen here—only deciding *what* we're going to //! paint. +#![allow(clippy::too_many_arguments)] + use std::default::Default; use std::sync::Arc; use std::{f32, mem}; @@ -443,7 +445,7 @@ impl<'a> DisplayListBuildState<'a> { let mut list = Vec::new(); let root_context = mem::replace(&mut self.root_stacking_context, StackingContext::root()); - self.to_display_list_for_stacking_context(&mut list, root_context); + self.move_to_display_list_for_stacking_context(&mut list, root_context); DisplayList { list, @@ -451,7 +453,7 @@ impl<'a> DisplayListBuildState<'a> { } } - fn to_display_list_for_stacking_context( + fn move_to_display_list_for_stacking_context( &mut self, list: &mut Vec<DisplayItem>, stacking_context: StackingContext, @@ -473,7 +475,7 @@ impl<'a> DisplayListBuildState<'a> { .into_iter() .map(|index| index.to_define_item()), ); - self.to_display_list_for_items(list, child_items, info.children); + self.move_to_display_list_for_items(list, child_items, info.children); } else { let (push_item, pop_item) = stacking_context.to_display_list_items(); list.push(push_item); @@ -482,12 +484,12 @@ impl<'a> DisplayListBuildState<'a> { .into_iter() .map(|index| index.to_define_item()), ); - self.to_display_list_for_items(list, child_items, info.children); + self.move_to_display_list_for_items(list, child_items, info.children); list.push(pop_item); } } - fn to_display_list_for_items( + fn move_to_display_list_for_items( &mut self, list: &mut Vec<DisplayItem>, mut child_items: Vec<DisplayItem>, @@ -509,7 +511,7 @@ impl<'a> DisplayListBuildState<'a> { .map_or(false, |child| child.z_index < 0) { let context = child_stacking_contexts.next().unwrap(); - self.to_display_list_for_stacking_context(list, context); + self.move_to_display_list_for_stacking_context(list, context); } // Step 4: Block backgrounds and borders. @@ -524,7 +526,7 @@ impl<'a> DisplayListBuildState<'a> { child.context_type == StackingContextType::PseudoFloat }) { let context = child_stacking_contexts.next().unwrap(); - self.to_display_list_for_stacking_context(list, context); + self.move_to_display_list_for_stacking_context(list, context); } // Step 6 & 7: Content and inlines that generate stacking contexts. @@ -536,7 +538,7 @@ impl<'a> DisplayListBuildState<'a> { // Step 8 & 9: Positioned descendants with nonnegative, numeric z-indices. for child in child_stacking_contexts { - self.to_display_list_for_stacking_context(list, child); + self.move_to_display_list_for_stacking_context(list, child); } // Step 10: Outlines. @@ -2642,10 +2644,10 @@ impl BlockFlow { // The margins control which edges have sticky behavior. let sticky_frame_data = StickyFrameData { margins: SideOffsets2D::new( - sticky_position.top.to_option().map(|v| v.to_f32_px()), - sticky_position.right.to_option().map(|v| v.to_f32_px()), - sticky_position.bottom.to_option().map(|v| v.to_f32_px()), - sticky_position.left.to_option().map(|v| v.to_f32_px()), + sticky_position.top.as_option().map(|v| v.to_f32_px()), + sticky_position.right.as_option().map(|v| v.to_f32_px()), + sticky_position.bottom.as_option().map(|v| v.to_f32_px()), + sticky_position.left.as_option().map(|v| v.to_f32_px()), ), vertical_offset_bounds, horizontal_offset_bounds, |