ok now it fails in a different place

This commit is contained in:
🪞👃🪞 2025-01-14 00:41:05 +01:00
parent 585bba6666
commit 23fe9f0949
9 changed files with 82 additions and 130 deletions

View file

@ -41,29 +41,24 @@ macro_rules! transform_xy_unit {
$layout.into()
}
}
impl<'a, T, E, A> TryFromEdn<'a, T> for $Enum<E, E::Unit, A>
where
T: EdnProvide<'a, E::Unit> + EdnProvide<'a, A> + 'a,
E: Output,
A: Render<E> + 'a,
{
impl<'a, E: Output + 'a, T: EdnViewData<'a, E>> TryFromEdn<'a, T> for $Enum<E, E::Unit, RenderBox<'a, E>> {
fn try_from_edn (
state: &'a T, head: &EdnItem<&str>, tail: &'a [EdnItem<&str>]
) -> Option<Self> {
use EdnItem::*;
Some(match (head, tail) {
(Key($x), [x, a]) => Self::x(
state.get(x).expect("no content"),
state.get(a).expect("no content"),
state.get_unit(x).expect("no x"),
state.get_content(a).expect("no content"),
),
(Key($y), [y, a]) => Self::y(
state.get(y).expect("no content"),
state.get(a).expect("no content"),
state.get_unit(y).expect("no y"),
state.get_content(a).expect("no content"),
),
(Key($xy), [x, y, a]) => Self::xy(
state.get(x).expect("no content"),
state.get(y).expect("no content"),
state.get(a).expect("no content"),
state.get_unit(x).expect("no x"),
state.get_unit(y).expect("no y"),
state.get_content(a).expect("no content"),
),
_ => return None
})