mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: start replacing EdnViewData with EdnProvide
This commit is contained in:
parent
fc06fb863b
commit
1ff35baea9
8 changed files with 151 additions and 113 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue