summaryrefslogtreecommitdiff
path: root/library/src/math/accent.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-06-06 21:13:59 +0200
committerLaurenz <laurmaedje@gmail.com>2023-06-06 22:06:16 +0200
commitfd417da04f7ca4b995de7f6510abafd3e9c31307 (patch)
tree3675529c75ca7363701ac8ea306de2cc1d3cbcb3 /library/src/math/accent.rs
parent168bdf35bd773e67343c965cb473492cc5cae9e7 (diff)
Improve value casting infrastructure
Diffstat (limited to 'library/src/math/accent.rs')
-rw-r--r--library/src/math/accent.rs7
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()
-}