diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-07 14:30:50 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-07 14:43:13 +0100 |
| commit | 0a41844cc4e645e87fe48aa31ed3a4fd40a6ab11 (patch) | |
| tree | c7cac97079491c8a11afae1211d7a80415fe64ef /library/src | |
| parent | efd1853d069fbd1476e82d015da4d0d04cfaccc0 (diff) | |
Selectors
Diffstat (limited to 'library/src')
| -rw-r--r-- | library/src/math/mod.rs | 2 | ||||
| -rw-r--r-- | library/src/prelude.rs | 2 | ||||
| -rw-r--r-- | library/src/structure/heading.rs | 4 | ||||
| -rw-r--r-- | library/src/structure/list.rs | 6 | ||||
| -rw-r--r-- | library/src/structure/reference.rs | 2 | ||||
| -rw-r--r-- | library/src/structure/table.rs | 4 | ||||
| -rw-r--r-- | library/src/text/deco.rs | 4 | ||||
| -rw-r--r-- | library/src/text/link.rs | 4 | ||||
| -rw-r--r-- | library/src/text/mod.rs | 8 | ||||
| -rw-r--r-- | library/src/text/raw.rs | 2 | ||||
| -rw-r--r-- | library/src/text/shift.rs | 2 |
11 files changed, 20 insertions, 20 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs index 0fad2939..a89b4953 100644 --- a/library/src/math/mod.rs +++ b/library/src/math/mod.rs @@ -39,7 +39,7 @@ impl MathNode { } impl Show for MathNode { - fn unguard_parts(&self, _: Selector) -> Content { + fn unguard_parts(&self, _: RecipeId) -> Content { self.clone().pack() } diff --git a/library/src/prelude.rs b/library/src/prelude.rs index f51b826f..f08604a8 100644 --- a/library/src/prelude.rs +++ b/library/src/prelude.rs @@ -9,7 +9,7 @@ pub use typst::frame::*; pub use typst::geom::*; pub use typst::model::{ array, capability, castable, dict, dynamic, format_str, node, Args, Array, Cast, - Content, Dict, Finalize, Fold, Func, Key, Node, Resolve, Scope, Selector, Show, + Content, Dict, Finalize, Fold, Func, Key, Node, RecipeId, Resolve, Scope, Show, Smart, Str, StyleChain, StyleMap, StyleVec, Value, Vm, }; pub use typst::syntax::{Span, Spanned}; diff --git a/library/src/structure/heading.rs b/library/src/structure/heading.rs index 46e98c18..f93be5d9 100644 --- a/library/src/structure/heading.rs +++ b/library/src/structure/heading.rs @@ -78,8 +78,8 @@ impl HeadingNode { } impl Show for HeadingNode { - fn unguard_parts(&self, sel: Selector) -> Content { - Self { body: self.body.unguard(sel), ..*self }.pack() + fn unguard_parts(&self, id: RecipeId) -> Content { + Self { body: self.body.unguard(id), ..*self }.pack() } fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { diff --git a/library/src/structure/list.rs b/library/src/structure/list.rs index 499207a4..89dc0f35 100644 --- a/library/src/structure/list.rs +++ b/library/src/structure/list.rs @@ -94,9 +94,9 @@ impl<const L: ListKind> ListNode<L> { } impl<const L: ListKind> Show for ListNode<L> { - fn unguard_parts(&self, sel: Selector) -> Content { + fn unguard_parts(&self, id: RecipeId) -> Content { Self { - items: self.items.map(|item| item.unguard(sel)), + items: self.items.map(|item| item.unguard(id)), ..*self } .pack() @@ -208,7 +208,7 @@ impl ListItem { } } - fn unguard(&self, sel: Selector) -> Self { + fn unguard(&self, sel: RecipeId) -> Self { match self { Self::List(body) => Self::List(Box::new(body.unguard(sel))), Self::Enum(number, body) => Self::Enum(*number, Box::new(body.unguard(sel))), diff --git a/library/src/structure/reference.rs b/library/src/structure/reference.rs index 18f4eecb..7004f49e 100644 --- a/library/src/structure/reference.rs +++ b/library/src/structure/reference.rs @@ -20,7 +20,7 @@ impl RefNode { } impl Show for RefNode { - fn unguard_parts(&self, _: Selector) -> Content { + fn unguard_parts(&self, _: RecipeId) -> Content { Self(self.0.clone()).pack() } diff --git a/library/src/structure/table.rs b/library/src/structure/table.rs index fbf1c7c0..8c6191be 100644 --- a/library/src/structure/table.rs +++ b/library/src/structure/table.rs @@ -58,11 +58,11 @@ impl TableNode { } impl Show for TableNode { - fn unguard_parts(&self, sel: Selector) -> Content { + fn unguard_parts(&self, id: RecipeId) -> Content { Self { tracks: self.tracks.clone(), gutter: self.gutter.clone(), - cells: self.cells.iter().map(|cell| cell.unguard(sel)).collect(), + cells: self.cells.iter().map(|cell| cell.unguard(id)).collect(), } .pack() } diff --git a/library/src/text/deco.rs b/library/src/text/deco.rs index fa0f05a7..bc7a312d 100644 --- a/library/src/text/deco.rs +++ b/library/src/text/deco.rs @@ -47,8 +47,8 @@ impl<const L: DecoLine> DecoNode<L> { } impl<const L: DecoLine> Show for DecoNode<L> { - fn unguard_parts(&self, sel: Selector) -> Content { - Self(self.0.unguard(sel)).pack() + fn unguard_parts(&self, id: RecipeId) -> Content { + Self(self.0.unguard(id)).pack() } fn show(&self, _: Tracked<dyn World>, styles: StyleChain) -> SourceResult<Content> { diff --git a/library/src/text/link.rs b/library/src/text/link.rs index 4312559e..b74ca530 100644 --- a/library/src/text/link.rs +++ b/library/src/text/link.rs @@ -50,10 +50,10 @@ impl LinkNode { } impl Show for LinkNode { - fn unguard_parts(&self, sel: Selector) -> Content { + fn unguard_parts(&self, id: RecipeId) -> Content { Self { dest: self.dest.clone(), - body: self.body.as_ref().map(|body| body.unguard(sel)), + body: self.body.as_ref().map(|body| body.unguard(id)), } .pack() } diff --git a/library/src/text/mod.rs b/library/src/text/mod.rs index 86c6884a..a8164727 100644 --- a/library/src/text/mod.rs +++ b/library/src/text/mod.rs @@ -503,8 +503,8 @@ impl StrongNode { } impl Show for StrongNode { - fn unguard_parts(&self, sel: Selector) -> Content { - Self(self.0.unguard(sel)).pack() + fn unguard_parts(&self, id: RecipeId) -> Content { + Self(self.0.unguard(id)).pack() } fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { @@ -531,8 +531,8 @@ impl EmphNode { } impl Show for EmphNode { - fn unguard_parts(&self, sel: Selector) -> Content { - Self(self.0.unguard(sel)).pack() + fn unguard_parts(&self, id: RecipeId) -> Content { + Self(self.0.unguard(id)).pack() } fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { diff --git a/library/src/text/raw.rs b/library/src/text/raw.rs index 5a98cf3b..c6229d59 100644 --- a/library/src/text/raw.rs +++ b/library/src/text/raw.rs @@ -52,7 +52,7 @@ impl RawNode { } impl Show for RawNode { - fn unguard_parts(&self, _: Selector) -> Content { + fn unguard_parts(&self, _: RecipeId) -> Content { Self { text: self.text.clone(), ..*self }.pack() } diff --git a/library/src/text/shift.rs b/library/src/text/shift.rs index 0f654b5a..a91285bf 100644 --- a/library/src/text/shift.rs +++ b/library/src/text/shift.rs @@ -43,7 +43,7 @@ impl<const S: ShiftKind> ShiftNode<S> { } impl<const S: ShiftKind> Show for ShiftNode<S> { - fn unguard_parts(&self, _: Selector) -> Content { + fn unguard_parts(&self, _: RecipeId) -> Content { Self(self.0.clone()).pack() } |
