mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
clippy: Fix several warnings (#31710)
Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
This commit is contained in:
parent
1ab8fa2895
commit
f6a975fc58
23 changed files with 75 additions and 86 deletions
|
@ -1081,7 +1081,7 @@ impl<'a> FlexItem<'a> {
|
|||
box_size,
|
||||
&pbm,
|
||||
);
|
||||
let cross_size = flex_context.vec2_to_flex_relative(size.clone()).cross;
|
||||
let cross_size = flex_context.vec2_to_flex_relative(size).cross;
|
||||
let fragments = replaced.contents.make_fragments(&replaced.style, size);
|
||||
FlexItemLayoutResult {
|
||||
hypothetical_cross_size: cross_size.into(),
|
||||
|
|
|
@ -975,7 +975,7 @@ impl FloatBox {
|
|||
.into();
|
||||
children = replaced
|
||||
.contents
|
||||
.make_fragments(&replaced.style, content_size.clone().into());
|
||||
.make_fragments(&replaced.style, content_size.into());
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -1122,7 +1122,6 @@ impl<'a, 'b> InlineFormattingContextState<'a, 'b> {
|
|||
.placement_among_floats
|
||||
.get_or_init(|| self.place_line_among_floats(potential_line_size))
|
||||
.size
|
||||
.clone()
|
||||
} else {
|
||||
LogicalVec2 {
|
||||
inline: self.containing_block.inline_size.into(),
|
||||
|
@ -1991,9 +1990,7 @@ impl IndependentFormattingContext {
|
|||
None,
|
||||
&pbm,
|
||||
);
|
||||
let fragments = replaced
|
||||
.contents
|
||||
.make_fragments(&replaced.style, size.clone());
|
||||
let fragments = replaced.contents.make_fragments(&replaced.style, size);
|
||||
let content_rect = LogicalRect {
|
||||
start_corner: pbm_sums.start_offset(),
|
||||
size,
|
||||
|
|
|
@ -989,7 +989,7 @@ impl NonReplacedFormattingContext {
|
|||
&collapsed_margin_block_start,
|
||||
containing_block,
|
||||
&pbm,
|
||||
&content_size + &pbm.padding_border_sums.clone().into(),
|
||||
&content_size + &pbm.padding_border_sums.into(),
|
||||
&self.style,
|
||||
);
|
||||
} else {
|
||||
|
@ -1179,7 +1179,7 @@ fn layout_in_flow_replaced_block_level(
|
|||
let margin_inline_end;
|
||||
let effective_margin_inline_start;
|
||||
let (margin_block_start, margin_block_end) = solve_block_margins_for_in_flow_block_level(&pbm);
|
||||
let fragments = replaced.make_fragments(style, content_size.clone());
|
||||
let fragments = replaced.make_fragments(style, content_size);
|
||||
|
||||
let clearance;
|
||||
if let Some(ref mut sequential_layout_state) = sequential_layout_state {
|
||||
|
@ -1204,7 +1204,7 @@ fn layout_in_flow_replaced_block_level(
|
|||
&collapsed_margin_block_start,
|
||||
containing_block,
|
||||
&pbm,
|
||||
size.clone().into(),
|
||||
size.into(),
|
||||
style,
|
||||
);
|
||||
|
||||
|
@ -1498,7 +1498,7 @@ fn solve_clearance_and_inline_margins_avoiding_floats(
|
|||
style.get_box().clear,
|
||||
block_start_margin,
|
||||
pbm,
|
||||
size.clone().into(),
|
||||
size.into(),
|
||||
);
|
||||
let (inline_margins, effective_margin_inline_start) = solve_inline_margins_avoiding_floats(
|
||||
sequential_layout_state,
|
||||
|
|
|
@ -250,13 +250,13 @@ impl PositioningContext {
|
|||
new_fragment: &mut BoxFragment,
|
||||
) {
|
||||
let padding_rect = LogicalRect {
|
||||
size: new_fragment.content_rect.size.clone(),
|
||||
size: new_fragment.content_rect.size,
|
||||
// Ignore the content rect’s position in its own containing block:
|
||||
start_corner: LogicalVec2::zero(),
|
||||
}
|
||||
.inflate(&new_fragment.padding);
|
||||
let containing_block = DefiniteContainingBlock {
|
||||
size: padding_rect.size.clone().into(),
|
||||
size: padding_rect.size.into(),
|
||||
style: &new_fragment.style,
|
||||
};
|
||||
|
||||
|
@ -539,9 +539,7 @@ impl HoistedAbsolutelyPositionedBox {
|
|||
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
||||
let style = &replaced.style;
|
||||
content_size = computed_size.auto_is(|| unreachable!()).into();
|
||||
fragments = replaced
|
||||
.contents
|
||||
.make_fragments(style, content_size.clone());
|
||||
fragments = replaced.contents.make_fragments(style, content_size);
|
||||
},
|
||||
IndependentFormattingContext::NonReplaced(non_replaced) => {
|
||||
// https://drafts.csswg.org/css2/#min-max-widths
|
||||
|
|
|
@ -1478,7 +1478,7 @@ impl<'a> TableLayout<'a> {
|
|||
baselines.last = Some(row_end);
|
||||
}
|
||||
|
||||
let column_indices = 0..self.table.size.width.clone();
|
||||
let column_indices = 0..self.table.size.width;
|
||||
row_fragment_layout.fragments.reserve(self.table.size.width);
|
||||
for column_index in column_indices {
|
||||
// The PositioningContext for cells is, in order or preference, the PositioningContext of the row,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue