Fix clippy wanings in layout (#33215)

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
atbrakhi 2024-08-27 22:53:43 +02:00 committed by GitHub
parent 12661c1920
commit 2037884469
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 7 deletions

View file

@ -1114,7 +1114,7 @@ impl InitialFlexLineLayout<'_> {
let item_layout_results = items let item_layout_results = items
.iter_mut() .iter_mut()
.zip(&item_used_main_sizes) .zip(&item_used_main_sizes)
.map(|(item, &used_main_size)| item.layout(used_main_size, &flex_context, None)) .map(|(item, &used_main_size)| item.layout(used_main_size, flex_context, None))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
// https://drafts.csswg.org/css-flexbox/#algo-cross-line // https://drafts.csswg.org/css-flexbox/#algo-cross-line
@ -1411,7 +1411,7 @@ impl InitialFlexLineLayout<'_> {
// treating this used size as its definite cross size // treating this used size as its definite cross size
// so that percentage-sized children can be resolved.” // so that percentage-sized children can be resolved.”
*item_layout_result = *item_layout_result =
item.layout(*used_main_size, &flex_context, Some(used_cross_size)); item.layout(*used_main_size, flex_context, Some(used_cross_size));
} }
// TODO: This also needs to check whether we have a compatible writing mode. // TODO: This also needs to check whether we have a compatible writing mode.

View file

@ -1442,9 +1442,7 @@ impl<'layout_dta> InlineFormattingContextLayout<'layout_dta> {
assert!(!will_break); assert!(!will_break);
} }
self.current_line self.current_line.line_items.extend(segment_items);
.line_items
.extend(segment_items.into_iter());
self.current_line.has_content |= self.current_line_segment.has_content; self.current_line.has_content |= self.current_line_segment.has_content;
self.current_line_segment.reset(); self.current_line_segment.reset();
@ -1964,7 +1962,6 @@ impl IndependentFormattingContext {
non_replaced non_replaced
.inline_content_sizes(layout.layout_context) .inline_content_sizes(layout.layout_context)
.shrink_to_fit(available_size) .shrink_to_fit(available_size)
.into()
}); });
// https://drafts.csswg.org/css2/visudet.html#min-max-widths // https://drafts.csswg.org/css2/visudet.html#min-max-widths

View file

@ -374,7 +374,7 @@ impl TextRun {
specified_word_spacing.to_used_value(Au::from_f64_px(space_width)) specified_word_spacing.to_used_value(Au::from_f64_px(space_width))
}); });
let mut flags = flags.clone(); let mut flags = flags;
if segment.bidi_level.is_rtl() { if segment.bidi_level.is_rtl() {
flags.insert(ShapingFlags::RTL_FLAG); flags.insert(ShapingFlags::RTL_FLAG);
} }