aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
diff options
context:
space:
mode:
authoreri <eri@inventati.org>2024-03-11 15:24:33 +0100
committerGitHub <noreply@github.com>2024-03-11 14:24:33 +0000
commitb03411f56771dfb45ec4c8a3d9888caac65abaf9 (patch)
treea721801581950ca871062a7508019b9bfe6e793c /components/layout_2020/flow/construct.rs
parent1d1f239ecc8bccef7869425f1fb4925fecf0e2c1 (diff)
downloadservo-b03411f56771dfb45ec4c8a3d9888caac65abaf9.tar.gz
servo-b03411f56771dfb45ec4c8a3d9888caac65abaf9.zip
clippy: Fix warnings in `components/layout_2020` (#31611)
* clippy: fix warnings in components/layout_2020 * fix: review comments
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(