diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-25 10:36:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-25 12:16:13 +0100 |
| commit | bf5edbbbbb75120d065d1c9587ccfa4eed4fdca1 (patch) | |
| tree | 956af910ab27a8cec0db83171cd3f0b6d0570a60 /library/src/structure/heading.rs | |
| parent | 96f72eee6c6b595164c7a0576c407d7a590661db (diff) | |
Tidy up
Diffstat (limited to 'library/src/structure/heading.rs')
| -rw-r--r-- | library/src/structure/heading.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/library/src/structure/heading.rs b/library/src/structure/heading.rs index cf732a4e..063f3c97 100644 --- a/library/src/structure/heading.rs +++ b/library/src/structure/heading.rs @@ -34,18 +34,13 @@ impl HeadingNode { } impl Show for HeadingNode { - fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { - Ok(BlockNode(self.body.clone()).pack()) + fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> Content { + BlockNode(self.body.clone()).pack() } } impl Finalize for HeadingNode { - fn finalize( - &self, - _: Tracked<dyn World>, - _: StyleChain, - realized: Content, - ) -> SourceResult<Content> { + fn finalize(&self, realized: Content) -> Content { let scale = match self.level.get() { 1 => 1.4, 2 => 1.2, @@ -61,7 +56,6 @@ impl Finalize for HeadingNode { map.set(TextNode::WEIGHT, FontWeight::BOLD); map.set(BlockNode::ABOVE, VNode::block_around(above.into())); map.set(BlockNode::BELOW, VNode::block_around(below.into())); - - Ok(realized.styled_with_map(map)) + realized.styled_with_map(map) } } |
