diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-24 14:39:53 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-24 14:53:43 +0200 |
| commit | 50e4002a2a65c27f46895103c59cb775ca60d16d (patch) | |
| tree | dbd43c16ae8456536c89d64d2cfff293bb6b1148 /src/library/text/mod.rs | |
| parent | 04fb8b288aa7c80607da79db7d085a4820b95a9d (diff) | |
Split `show` into `realize` and `finalize`
Diffstat (limited to 'src/library/text/mod.rs')
| -rw-r--r-- | src/library/text/mod.rs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/library/text/mod.rs b/src/library/text/mod.rs index e477e76d..3cfbc55d 100644 --- a/src/library/text/mod.rs +++ b/src/library/text/mod.rs @@ -475,13 +475,8 @@ impl Show for StrongNode { dict! { "body" => Value::Content(self.0.clone()) } } - fn show( - &self, - _: &mut Context, - _: StyleChain, - realized: Option<Content>, - ) -> TypResult<Content> { - Ok(realized.unwrap_or_else(|| self.0.clone().styled(TextNode::STRONG, Toggle))) + fn realize(&self, _: &mut Context, _: StyleChain) -> TypResult<Content> { + Ok(self.0.clone().styled(TextNode::STRONG, Toggle)) } } @@ -501,12 +496,7 @@ impl Show for EmphNode { dict! { "body" => Value::Content(self.0.clone()) } } - fn show( - &self, - _: &mut Context, - _: StyleChain, - realized: Option<Content>, - ) -> TypResult<Content> { - Ok(realized.unwrap_or_else(|| self.0.clone().styled(TextNode::EMPH, Toggle))) + fn realize(&self, _: &mut Context, _: StyleChain) -> TypResult<Content> { + Ok(self.0.clone().styled(TextNode::EMPH, Toggle)) } } |
