parse defs with the new approach

This commit is contained in:
Folkert 2022-05-26 14:14:39 +02:00
parent d174cb72ae
commit fa9ac912a0
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 76 additions and 49 deletions

View file

@ -346,7 +346,7 @@ pub struct Defs<'a> {
}
impl<'a> Defs<'a> {
pub fn defs<I>(&self) -> impl Iterator<Item = Result<&TypeDef<'a>, &ValueDef<'a>>> {
pub fn defs(&self) -> impl Iterator<Item = Result<&TypeDef<'a>, &ValueDef<'a>>> {
self.tags.iter().map(|tag| match tag.split() {
Ok(type_index) => Ok(&self.type_defs[type_index.index()]),
Err(value_index) => Err(&self.value_defs[value_index.index()]),