fixed up some parsing and removed some edn mentions

This commit is contained in:
🪞👃🪞 2025-01-18 01:54:06 +01:00
parent 5e7b867aba
commit 452bdf9598
15 changed files with 290 additions and 292 deletions

View file

@ -7,8 +7,8 @@ impl<E, A> When<E, A> {
Self(Default::default(), c, a)
}
}
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromEdn<'a, T> for When<E, RenderBox<'a, E>> {
fn try_from_edn (
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromAtom<'a, T> for When<E, RenderBox<'a, E>> {
fn try_from_atom (
state: &'a T, head: &impl Atom, tail: &'a [impl Atom]
) -> Option<Self> {
if let (Key("when"), [condition, content]) = (head.to_ref(), tail) {
@ -47,8 +47,8 @@ impl<E, A, B> Either<E, A, B> {
Self(Default::default(), c, a, b)
}
}
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromEdn<'a, T> for Either<E, RenderBox<'a, E>, RenderBox<'a, E>> {
fn try_from_edn (state: &'a T, head: &impl Atom, tail: &'a [impl Atom]) -> Option<Self> {
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromAtom<'a, T> for Either<E, RenderBox<'a, E>, RenderBox<'a, E>> {
fn try_from_atom (state: &'a T, head: &impl Atom, tail: &'a [impl Atom]) -> Option<Self> {
if let (Key("either"), [condition, content, alternative]) = (head.to_ref(), tail) {
Some(Self::new(
state.get_bool(condition).expect("either: no condition"),