diff options
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/styles.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/model/styles.rs b/src/model/styles.rs index 8cccb5f6..7b725af9 100644 --- a/src/model/styles.rs +++ b/src/model/styles.rs @@ -343,12 +343,7 @@ impl Debug for Transform { cast_from_value! { Transform, content: Content => Self::Content(content), - func: Func => { - if func.argc().map_or(false, |count| count != 1) { - Err("function must have exactly one parameter")? - } - Self::Func(func) - }, + func: Func => Self::Func(func), } /// A chain of style maps, similar to a linked list. @@ -494,6 +489,15 @@ impl<'a> StyleChain<'a> { }) } + /// Convert to a style map. + pub fn to_map(self) -> StyleMap { + let mut suffix = StyleMap::new(); + for link in self.links() { + suffix.0.splice(0..0, link.iter().cloned()); + } + suffix + } + /// Iterate over the entries of the chain. fn entries(self) -> Entries<'a> { Entries { inner: [].as_slice().iter(), links: self.links() } |
