diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-07-26 23:24:50 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-07-26 23:27:44 +0200 |
| commit | fc574b39454aec77cf2c33270566225917c7c823 (patch) | |
| tree | ccebc217ce9f869bb0078753a7749789d77db551 /src/eval/cast.rs | |
| parent | 1e9a5eda48c65096b482b396d550d139a4c2e61d (diff) | |
New `Str` type with methods
Diffstat (limited to 'src/eval/cast.rs')
| -rw-r--r-- | src/eval/cast.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/eval/cast.rs b/src/eval/cast.rs index 063d378a..b27e3edc 100644 --- a/src/eval/cast.rs +++ b/src/eval/cast.rs @@ -5,6 +5,7 @@ use crate::diag::{with_alternative, StrResult}; use crate::geom::{Corners, Dir, Paint, Sides}; use crate::model::{Content, Group, Layout, LayoutNode, Pattern}; use crate::syntax::Spanned; +use crate::util::EcoString; /// Cast from a value to a specific type. pub trait Cast<V = Value>: Sized { @@ -163,6 +164,12 @@ castable! { } castable! { + EcoString, + Expected: "string", + Value::Str(str) => str.into(), +} + +castable! { String, Expected: "string", Value::Str(string) => string.into(), |
