wip: start replacing EdnViewData with EdnProvide

This commit is contained in:
🪞👃🪞 2025-01-12 15:26:37 +01:00
parent fc06fb863b
commit 1ff35baea9
8 changed files with 151 additions and 113 deletions

View file

@ -23,3 +23,12 @@ pub trait EdnProvide<U> {
self.get(edn).expect("no value")
}
}
impl<T: EdnProvide<U>, U> EdnProvide<U> for &T {
fn get <S: AsRef<str>> (&self, edn: &EdnItem<S>) -> Option<U> {
(*self).get(edn)
}
fn get_or_fail <S: AsRef<str>> (&self, edn: &EdnItem<S>) -> U {
(*self).get_or_fail(edn)
}
}