clippy: Fix warnings in components/layout_2020 (#31611)

* clippy: fix warnings in components/layout_2020

* fix: review comments
This commit is contained in:
eri 2024-03-11 15:24:33 +01:00 committed by GitHub
parent 1d1f239ecc
commit b03411f567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 59 additions and 69 deletions

View file

@ -54,7 +54,7 @@ impl BlockFormattingContext {
}
}
pub fn construct_for_text_runs<'dom>(
pub fn construct_for_text_runs(
runs: impl Iterator<Item = TextRun>,
layout_context: &LayoutContext,
text_decoration_line: TextDecorationLine,
@ -409,15 +409,11 @@ where
// collecting all Cow strings into a vector and passing them along to text breaking
// and shaping during final InlineFormattingContext construction.
let inlines = self.current_inline_level_boxes();
match inlines.last_mut().map(|last| last.borrow_mut()) {
Some(mut last_box) => match *last_box {
InlineLevelBox::TextRun(ref mut text_run) => {
text_run.text.push_str(&input);
return;
},
_ => {},
},
_ => {},
if let Some(mut last_box) = inlines.last_mut().map(|last| last.borrow_mut()) {
if let InlineLevelBox::TextRun(ref mut text_run) = *last_box {
text_run.text.push_str(&input);
return;
}
}
inlines.push(ArcRefCell::new(InlineLevelBox::TextRun(TextRun::new(