aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/parallel.rs
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2024-01-30 12:46:35 +0100
committerGitHub <noreply@github.com>2024-01-30 11:46:35 +0000
commitf7ead9bcb6fca650b797a9ac53a2de13c882d86c (patch)
tree0dce7dc5b1e64238b97658c9738f935e74c2308f /components/layout/parallel.rs
parent16cabcf7368538dafd6c59eb37a2fa651ac8ff1b (diff)
downloadservo-f7ead9bcb6fca650b797a9ac53a2de13c882d86c.tar.gz
servo-f7ead9bcb6fca650b797a9ac53a2de13c882d86c.zip
Lint layout_2013 with clippy (#31221)
* Lint layout_2013 with clippy CARGO_BUILD_RUSTC=rustc cargo clippy --fix -p layout_2013 --broken-code * ./mach fmt * Cosmetic adjustments
Diffstat (limited to 'components/layout/parallel.rs')
-rw-r--r--components/layout/parallel.rs26
1 files changed, 16 insertions, 10 deletions
diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs
index 2093992c4d0..cd15063ea57 100644
--- a/components/layout/parallel.rs
+++ b/components/layout/parallel.rs
@@ -60,6 +60,12 @@ impl FlowParallelInfo {
}
}
+impl Default for FlowParallelInfo {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
/// Process current flow and potentially traverse its ancestors.
///
/// If we are the last child that finished processing, recursively process
@@ -145,7 +151,7 @@ fn top_down_flow<'scope>(
// If there were no more children, start assigning block-sizes.
if !had_children {
- bottom_up_flow(*unsafe_flow, &assign_bsize_traversal)
+ bottom_up_flow(*unsafe_flow, assign_bsize_traversal)
}
}
@@ -159,8 +165,8 @@ fn top_down_flow<'scope>(
&discovered_child_flows,
pool,
scope,
- &assign_isize_traversal,
- &assign_bsize_traversal,
+ assign_isize_traversal,
+ assign_bsize_traversal,
);
} else {
// Spawn a new work unit for each chunk after the first.
@@ -173,8 +179,8 @@ fn top_down_flow<'scope>(
&nodes,
pool,
scope,
- &assign_isize_traversal,
- &assign_bsize_traversal,
+ assign_isize_traversal,
+ assign_bsize_traversal,
);
});
}
@@ -183,8 +189,8 @@ fn top_down_flow<'scope>(
chunk,
pool,
scope,
- &assign_isize_traversal,
- &assign_bsize_traversal,
+ assign_isize_traversal,
+ assign_bsize_traversal,
);
}
}
@@ -200,16 +206,16 @@ pub fn reflow(
) {
if opts::get().debug.bubble_inline_sizes_separately {
let bubble_inline_sizes = BubbleISizes {
- layout_context: &context,
+ layout_context: context,
};
bubble_inline_sizes.traverse(root);
}
let assign_isize_traversal = &AssignISizes {
- layout_context: &context,
+ layout_context: context,
};
let assign_bsize_traversal = &AssignBSizes {
- layout_context: &context,
+ layout_context: context,
};
let nodes = [UnsafeFlow(root)];