mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
fix missing content
This commit is contained in:
parent
e62e36d558
commit
df50bb9f47
3 changed files with 22 additions and 10 deletions
|
|
@ -95,12 +95,24 @@ impl<'a, E: Output + 'a, T: EdnViewData<'a, E>> TryFromEdn<'a, T> for Bsp<E, Ren
|
|||
fn try_from_edn (s: &'a T, head: &EdnItem<&str>, tail: &'a [EdnItem<&str>]) -> Option<Self> {
|
||||
use EdnItem::*;
|
||||
Some(match (head, tail) {
|
||||
(Key("bsp/n"), [a, b]) => Self::n(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
||||
(Key("bsp/s"), [a, b]) => Self::s(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
||||
(Key("bsp/e"), [a, b]) => Self::e(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
||||
(Key("bsp/w"), [a, b]) => Self::w(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
||||
(Key("bsp/a"), [a, b]) => Self::a(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
||||
(Key("bsp/b"), [a, b]) => Self::b(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
||||
(Key("bsp/n"), [a, b]) => Self::n(
|
||||
s.get_content(a).expect("no a"),
|
||||
s.get_content(b).expect("no b")),
|
||||
(Key("bsp/s"), [a, b]) => Self::s(
|
||||
s.get_content(a).expect("no a"),
|
||||
s.get_content(b).expect("no b")),
|
||||
(Key("bsp/e"), [a, b]) => Self::e(
|
||||
s.get_content(a).expect("no a"),
|
||||
s.get_content(b).expect("no b")),
|
||||
(Key("bsp/w"), [a, b]) => Self::w(
|
||||
s.get_content(a).expect("no a"),
|
||||
s.get_content(b).expect("no b")),
|
||||
(Key("bsp/a"), [a, b]) => Self::a(
|
||||
s.get_content(a).expect("no a"),
|
||||
s.get_content(b).expect("no b")),
|
||||
(Key("bsp/b"), [a, b]) => Self::b(
|
||||
s.get_content(a).expect("no a"),
|
||||
s.get_content(b).expect("no b")),
|
||||
_ => return None
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ impl<'a, E: Output + 'a, T: EdnViewData<'a, E>> TryFromEdn<'a, T> for Either<E,
|
|||
use EdnItem::*;
|
||||
if let (Key("either"), [condition, content, alternative]) = (head, tail) {
|
||||
Some(Self::new(
|
||||
state.get(condition).expect("either: no condition"),
|
||||
state.get(content).expect("either: no content"),
|
||||
state.get(alternative).expect("either: no alternative")
|
||||
state.get_bool(condition).expect("either: no condition"),
|
||||
state.get_content(content).expect("either: no content"),
|
||||
state.get_content(alternative).expect("either: no alternative")
|
||||
))
|
||||
} else {
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue