aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_2020/flow/construct.rs')
-rw-r--r--components/layout_2020/flow/construct.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs
index cd2dfffc4d0..78ac76d2c6a 100644
--- a/components/layout_2020/flow/construct.rs
+++ b/components/layout_2020/flow/construct.rs
@@ -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(