summaryrefslogtreecommitdiff
path: root/library/src/layout
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-18 11:23:56 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-18 11:23:56 +0100
commitc3895cbd66688c8d677d5795813432b9a72b3ef9 (patch)
treef8b6338076ed21db80cc706ce2be6e98a1626276 /library/src/layout
parentddb617390cf7150042726742749806eab6b3dd54 (diff)
Remove `Target` enum
Diffstat (limited to 'library/src/layout')
-rw-r--r--library/src/layout/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/src/layout/mod.rs b/library/src/layout/mod.rs
index 605da3b2..5812115a 100644
--- a/library/src/layout/mod.rs
+++ b/library/src/layout/mod.rs
@@ -33,7 +33,7 @@ use typst::frame::Frame;
use typst::geom::*;
use typst::model::{
capability, Content, Node, SequenceNode, Show, StyleChain, StyleEntry,
- StyleVecBuilder, StyledNode, Target,
+ StyleVecBuilder, StyledNode,
};
use typst::World;
@@ -312,8 +312,8 @@ impl<'a> Builder<'a> {
content: &'a Content,
styles: StyleChain<'a>,
) -> SourceResult<()> {
- if let Some(text) = content.downcast::<TextNode>() {
- if let Some(realized) = styles.apply(self.world, Target::Text(&text.0))? {
+ if content.is::<TextNode>() {
+ if let Some(realized) = styles.apply(self.world, content)? {
let stored = self.scratch.content.alloc(realized);
return self.accept(stored, styles);
}
@@ -362,7 +362,7 @@ impl<'a> Builder<'a> {
}
fn show(&mut self, content: &Content, styles: StyleChain<'a>) -> SourceResult<bool> {
- let Some(realized) = styles.apply(self.world, Target::Node(content))? else {
+ let Some(realized) = styles.apply(self.world, content)? else {
return Ok(false);
};