diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-10-31 13:49:10 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-10-31 13:49:10 +0100 |
| commit | 671ce3dedd40067bb5cea84fe0739de013827053 (patch) | |
| tree | a4c990fc16b514f475dfceaa98d988e92ac6cf0c /src/library/structure/heading.rs | |
| parent | 636bdb9e438cfe4fb075a981e0512b9a3dde3e60 (diff) | |
Replace `encode` with `field`
Diffstat (limited to 'src/library/structure/heading.rs')
| -rw-r--r-- | src/library/structure/heading.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/library/structure/heading.rs b/src/library/structure/heading.rs index c967c6d7..fa96248f 100644 --- a/src/library/structure/heading.rs +++ b/src/library/structure/heading.rs @@ -73,12 +73,11 @@ impl Show for HeadingNode { Self { body: self.body.unguard(sel), ..*self }.pack() } - fn encode(&self, styles: StyleChain) -> Dict { - dict! { - "level" => Value::Int(self.level.get() as i64), - "body" => Value::Content(self.body.clone()), - "outlined" => Value::Bool(styles.get(Self::OUTLINED)), - "numbered" => Value::Bool(styles.get(Self::NUMBERED)), + fn field(&self, name: &str) -> Option<Value> { + match name { + "level" => Some(Value::Int(self.level.get() as i64)), + "body" => Some(Value::Content(self.body.clone())), + _ => None, } } |
