mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Lint layout_2020 with clippy (#31196)
cargo clippy --fix -p layout_2020 --allow-dirty --broken-code
This commit is contained in:
parent
79c98f0850
commit
33127e0e60
2 changed files with 8 additions and 10 deletions
|
@ -160,11 +160,9 @@ impl IndependentFormattingContext {
|
|||
let content_sizes = &mut non_replaced.content_sizes;
|
||||
let contents = &mut non_replaced.contents;
|
||||
sizing::outer_inline(style, containing_block_writing_mode, || {
|
||||
content_sizes
|
||||
.get_or_insert_with(|| {
|
||||
contents.inline_content_sizes(layout_context, style.writing_mode)
|
||||
})
|
||||
.clone()
|
||||
*content_sizes.get_or_insert_with(|| {
|
||||
contents.inline_content_sizes(layout_context, style.writing_mode)
|
||||
})
|
||||
})
|
||||
},
|
||||
Self::Replaced(replaced) => {
|
||||
|
@ -199,9 +197,9 @@ impl NonReplacedFormattingContext {
|
|||
pub fn inline_content_sizes(&mut self, layout_context: &LayoutContext) -> ContentSizes {
|
||||
let writing_mode = self.style.writing_mode;
|
||||
let contents = &mut self.contents;
|
||||
self.content_sizes
|
||||
*self
|
||||
.content_sizes
|
||||
.get_or_insert_with(|| contents.inline_content_sizes(layout_context, writing_mode))
|
||||
.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -174,13 +174,13 @@ impl<'a> TableLayout<'a> {
|
|||
.inline
|
||||
.non_auto()
|
||||
.and_then(|length_percentage| length_percentage.to_percentage())
|
||||
.unwrap_or_else(|| Percentage(0.));
|
||||
.unwrap_or(Percentage(0.));
|
||||
let max_inline_size_percent = cell
|
||||
.style
|
||||
.max_box_size(writing_mode)
|
||||
.inline
|
||||
.and_then(|length_percentage| length_percentage.to_percentage())
|
||||
.unwrap_or_else(|| Percentage(f32::INFINITY));
|
||||
.unwrap_or(Percentage(f32::INFINITY));
|
||||
let percentage_contribution =
|
||||
Percentage(inline_size_percent.0.min(max_inline_size_percent.0));
|
||||
|
||||
|
@ -649,7 +649,7 @@ impl<'a> TableLayout<'a> {
|
|||
let resolved = self
|
||||
.assignable_width
|
||||
.scale_by(column_measure.percentage_width.0);
|
||||
let percent_guess = min_content_width.max(resolved.into());
|
||||
let percent_guess = min_content_width.max(resolved);
|
||||
(percent_guess, percent_guess, percent_guess)
|
||||
} else if constrained {
|
||||
(min_content_width, max_content_width, max_content_width)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue