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/table.rs | |
| parent | 636bdb9e438cfe4fb075a981e0512b9a3dde3e60 (diff) | |
Replace `encode` with `field`
Diffstat (limited to 'src/library/structure/table.rs')
| -rw-r--r-- | src/library/structure/table.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/library/structure/table.rs b/src/library/structure/table.rs index a2f583f7..41dcd104 100644 --- a/src/library/structure/table.rs +++ b/src/library/structure/table.rs @@ -57,14 +57,12 @@ impl Show for TableNode { .pack() } - fn encode(&self, _: StyleChain) -> Dict { - dict! { - "cells" => Value::Array( - self.cells - .iter() - .map(|cell| Value::Content(cell.clone())) - .collect() - ), + fn field(&self, name: &str) -> Option<Value> { + match name { + "cells" => Some(Value::Array( + self.cells.iter().cloned().map(Value::Content).collect(), + )), + _ => None, } } |
