diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-15 22:51:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-15 23:11:20 +0100 |
| commit | b6202b646a0d5ecced301d9bac8bfcaf977d7ee4 (patch) | |
| tree | 7d42cb50f9e66153e7e8b2217009684e25f54f42 /src/model/str.rs | |
| parent | f3980c704544a464f9729cc8bc9f97d3a7454769 (diff) | |
Reflection for castables
Diffstat (limited to 'src/model/str.rs')
| -rw-r--r-- | src/model/str.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/model/str.rs b/src/model/str.rs index 0c288d9b..d1bf9d23 100644 --- a/src/model/str.rs +++ b/src/model/str.rs @@ -442,9 +442,8 @@ pub enum StrPattern { castable! { StrPattern, - Expected: "string or regular expression", - Value::Str(text) => Self::Str(text), - @regex: Regex => Self::Regex(regex.clone()), + text: Str => Self::Str(text), + regex: Regex => Self::Regex(regex), } /// A side of a string. @@ -459,8 +458,7 @@ pub enum StrSide { castable! { StrSide, - Expected: "start or end", - @align: GenAlign => match align { + align: GenAlign => match align { GenAlign::Start => Self::Start, GenAlign::End => Self::End, _ => Err("expected either `start` or `end`")?, |
