diff options
Diffstat (limited to 'src/model/cast.rs')
| -rw-r--r-- | src/model/cast.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/model/cast.rs b/src/model/cast.rs index 6a78eebd..bfde1bdd 100644 --- a/src/model/cast.rs +++ b/src/model/cast.rs @@ -255,18 +255,24 @@ castable! { } castable! { - Destination, - Expected: "string or dictionary with `page`, `x`, and `y` keys", - Value::Str(string) => Self::Url(string.into()), + Location, + Expected: "dictionary with `page`, `x`, and `y` keys", Value::Dict(dict) => { let page = dict.get("page")?.clone().cast()?; let x: Length = dict.get("x")?.clone().cast()?; let y: Length = dict.get("y")?.clone().cast()?; - Self::Internal(Location { page, pos: Point::new(x.abs, y.abs) }) + Self { page, pos: Point::new(x.abs, y.abs) } }, } castable! { + Destination, + Expected: "string or dictionary with `page`, `x`, and `y` keys", + Value::Str(string) => Self::Url(string.into()), + v @ Value::Dict(_) => Self::Internal(v.cast()?), +} + +castable! { FontStyle, Expected: "string", Value::Str(string) => match string.as_str() { |
