summaryrefslogtreecommitdiff
path: root/library/src/meta
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-05 12:21:10 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-05 12:21:10 +0100
commit1d324235bd80fe8d1fb21b1e73ae9e3dfe918078 (patch)
tree342b3ad9f0ca40dbf6f51c2b29646ca6803fe85a /library/src/meta
parent1bb05677faa7bd6566e1231ed2b16547f476b143 (diff)
Make show rule fallible again
Diffstat (limited to 'library/src/meta')
-rw-r--r--library/src/meta/link.rs4
-rw-r--r--library/src/meta/outline.rs9
-rw-r--r--library/src/meta/reference.rs4
3 files changed, 11 insertions, 6 deletions
diff --git a/library/src/meta/link.rs b/library/src/meta/link.rs
index 52163371..34304ea9 100644
--- a/library/src/meta/link.rs
+++ b/library/src/meta/link.rs
@@ -50,8 +50,8 @@ impl LinkNode {
}
impl Show for LinkNode {
- fn show(&self, _: &mut Vt, _: &Content, _: StyleChain) -> Content {
- self.body.clone()
+ fn show(&self, _: &mut Vt, _: &Content, _: StyleChain) -> SourceResult<Content> {
+ Ok(self.body.clone())
}
}
diff --git a/library/src/meta/outline.rs b/library/src/meta/outline.rs
index b680a1ac..53535be5 100644
--- a/library/src/meta/outline.rs
+++ b/library/src/meta/outline.rs
@@ -44,7 +44,12 @@ impl Prepare for OutlineNode {
}
impl Show for OutlineNode {
- fn show(&self, vt: &mut Vt, _: &Content, styles: StyleChain) -> Content {
+ fn show(
+ &self,
+ vt: &mut Vt,
+ _: &Content,
+ styles: StyleChain,
+ ) -> SourceResult<Content> {
let mut seq = vec![];
if let Some(title) = styles.get(Self::TITLE) {
let body = title.clone().unwrap_or_else(|| {
@@ -137,6 +142,6 @@ impl Show for OutlineNode {
ancestors.push(node);
}
- BlockNode(Content::sequence(seq)).pack()
+ Ok(BlockNode(Content::sequence(seq)).pack())
}
}
diff --git a/library/src/meta/reference.rs b/library/src/meta/reference.rs
index c8e8ebdc..a04fd13f 100644
--- a/library/src/meta/reference.rs
+++ b/library/src/meta/reference.rs
@@ -20,7 +20,7 @@ impl RefNode {
}
impl Show for RefNode {
- fn show(&self, _: &mut Vt, _: &Content, _: StyleChain) -> Content {
- TextNode::packed(format_eco!("@{}", self.0))
+ fn show(&self, _: &mut Vt, _: &Content, _: StyleChain) -> SourceResult<Content> {
+ Ok(TextNode::packed(format_eco!("@{}", self.0)))
}
}