diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-29 13:37:25 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-29 14:18:13 +0100 |
| commit | 0efe669278a5e1c3f2985eba2f3360e91159c54a (patch) | |
| tree | 502712857c48f0decb5e698257c0a96d358a436e /library/src/structure/reference.rs | |
| parent | 836692e73cff0356e409a9ba5b4887b86809d4ca (diff) | |
Reorganize library and tests
Diffstat (limited to 'library/src/structure/reference.rs')
| -rw-r--r-- | library/src/structure/reference.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/library/src/structure/reference.rs b/library/src/structure/reference.rs deleted file mode 100644 index 948aa6f6..00000000 --- a/library/src/structure/reference.rs +++ /dev/null @@ -1,26 +0,0 @@ -use crate::prelude::*; -use crate::text::TextNode; - -/// A reference to a label. -#[derive(Debug, Hash)] -pub struct RefNode(pub EcoString); - -#[node(Show)] -impl RefNode { - fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> { - Ok(Self(args.expect("target")?).pack()) - } - - fn field(&self, name: &str) -> Option<Value> { - match name { - "target" => Some(Value::Str(self.0.clone().into())), - _ => None, - } - } -} - -impl Show for RefNode { - fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> Content { - TextNode::packed(format_eco!("@{}", self.0)) - } -} |
