mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
ok now it fails in a different place
This commit is contained in:
parent
585bba6666
commit
23fe9f0949
9 changed files with 82 additions and 130 deletions
|
|
@ -45,26 +45,21 @@ impl<E: Output, A: Content<E>> Content<E> for Align<E, A> {
|
|||
to.place(Content::layout(self, to.area()), &self.content())
|
||||
}
|
||||
}
|
||||
impl<'a, T, E, A> TryFromEdn<'a, T> for Align<E, A>
|
||||
where
|
||||
T: EdnProvide<'a, A> + 'a,
|
||||
E: Output,
|
||||
A: Render<E> + 'a,
|
||||
{
|
||||
impl<'a, E: Output + 'a, T: EdnViewData<'a, E>> TryFromEdn<'a, T> for Align<E, 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("align/c"), [a]) => Self::c(state.get(a).expect("no content")),
|
||||
(Key("align/x"), [a]) => Self::x(state.get(a).expect("no content")),
|
||||
(Key("align/y"), [a]) => Self::y(state.get(a).expect("no content")),
|
||||
(Key("align/n"), [a]) => Self::n(state.get(a).expect("no content")),
|
||||
(Key("align/s"), [a]) => Self::s(state.get(a).expect("no content")),
|
||||
(Key("align/e"), [a]) => Self::e(state.get(a).expect("no content")),
|
||||
(Key("align/w"), [a]) => Self::w(state.get(a).expect("no content")),
|
||||
(Key("align/nw"), [a]) => Self::nw(state.get(a).expect("no content")),
|
||||
(Key("align/ne"), [a]) => Self::ne(state.get(a).expect("no content")),
|
||||
(Key("align/sw"), [a]) => Self::sw(state.get(a).expect("no content")),
|
||||
(Key("align/se"), [a]) => Self::se(state.get(a).expect("no content")),
|
||||
(Key("align/c"), [a]) => Self::c(state.get_content(a).expect("no content")),
|
||||
(Key("align/x"), [a]) => Self::x(state.get_content(a).expect("no content")),
|
||||
(Key("align/y"), [a]) => Self::y(state.get_content(a).expect("no content")),
|
||||
(Key("align/n"), [a]) => Self::n(state.get_content(a).expect("no content")),
|
||||
(Key("align/s"), [a]) => Self::s(state.get_content(a).expect("no content")),
|
||||
(Key("align/e"), [a]) => Self::e(state.get_content(a).expect("no content")),
|
||||
(Key("align/w"), [a]) => Self::w(state.get_content(a).expect("no content")),
|
||||
(Key("align/nw"), [a]) => Self::nw(state.get_content(a).expect("no content")),
|
||||
(Key("align/ne"), [a]) => Self::ne(state.get_content(a).expect("no content")),
|
||||
(Key("align/sw"), [a]) => Self::sw(state.get_content(a).expect("no content")),
|
||||
(Key("align/se"), [a]) => Self::se(state.get_content(a).expect("no content")),
|
||||
_ => return None
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue