Skip to content

Commit

Permalink
clippy pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunkar committed Mar 26, 2024
1 parent 46df9a5 commit 0132139
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions noir/noir-repo/compiler/noirc_frontend/src/hir/def_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,36 +251,28 @@ impl CrateDefMap {

interner.get_all_globals().iter().for_each(|global_info| {
interner.global_attributes(&global_info.id).iter().for_each(|attr| {
match attr {
SecondaryAttribute::Abi(tag) => {
if let Some(tagged) = outputs.globals.get_mut(tag) {
tagged.push(global_info.id)
} else {
outputs
.globals
.insert(tag.to_string(), vec![global_info.id]);
}
if let SecondaryAttribute::Abi(tag) = attr {
if let Some(tagged) = outputs.globals.get_mut(tag) {
tagged.push(global_info.id);
} else {
outputs.globals.insert(tag.to_string(), vec![global_info.id]);
}
_ => (),
}
})
});
});

module.type_definitions().for_each(|id| match id {
ModuleDefId::TypeId(struct_id) => interner
.struct_attributes(&struct_id)
.iter()
.for_each(|attr| match attr {
SecondaryAttribute::Abi(tag) => {
module.type_definitions().for_each(|id| {
if let ModuleDefId::TypeId(struct_id) = id {
interner.struct_attributes(&struct_id).iter().for_each(|attr| {
if let SecondaryAttribute::Abi(tag) = attr {
if let Some(tagged) = outputs.structs.get_mut(tag) {
tagged.push(struct_id)
tagged.push(struct_id);
} else {
outputs.structs.insert(tag.to_string(), vec![struct_id]);
}
}
_ => (),
}),
_ => (),
});
}
});

let name = self.get_module_path(id, module.parent);
Expand Down

0 comments on commit 0132139

Please sign in to comment.