fix: unwrap used in a reachable place. Replaced with alternative option

This commit is contained in:
Kasey White
2023-02-08 03:43:42 -05:00
committed by Lucas
parent 9ae28aaa88
commit 076871492b
4 changed files with 88 additions and 1 deletions

View File

@@ -1205,7 +1205,9 @@ impl<'a> CodeGenerator<'a> {
indices: arguments_index
.iter()
.map(|(label, var_name, index)| {
let field_type = type_map.get(label).unwrap();
let field_type = type_map
.get(label)
.unwrap_or_else(|| type_map.get_index(*index).unwrap().1);
(*index, var_name.clone(), field_type.clone())
})
.collect_vec(),