mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
parse defs with the new approach
This commit is contained in:
parent
d174cb72ae
commit
fa9ac912a0
3 changed files with 76 additions and 49 deletions
|
@ -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()]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue