diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-06 21:13:59 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-06 22:06:16 +0200 |
| commit | fd417da04f7ca4b995de7f6510abafd3e9c31307 (patch) | |
| tree | 3675529c75ca7363701ac8ea306de2cc1d3cbcb3 /library/src/math/accent.rs | |
| parent | 168bdf35bd773e67343c965cb473492cc5cae9e7 (diff) | |
Improve value casting infrastructure
Diffstat (limited to 'library/src/math/accent.rs')
| -rw-r--r-- | library/src/math/accent.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/library/src/math/accent.rs b/library/src/math/accent.rs index 7878782b..4a12f5c5 100644 --- a/library/src/math/accent.rs +++ b/library/src/math/accent.rs @@ -128,15 +128,12 @@ impl Accent { } } -cast_from_value! { +cast! { Accent, + self => self.0.into_value(), v: char => Self::new(v), v: Content => match v.to::<TextElem>() { Some(elem) => Value::Str(elem.text().into()).cast()?, None => Err("expected text")?, }, } - -cast_to_value! { - v: Accent => v.0.into() -} |
