Skip to content

Commit

Permalink
switch to match statement
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm committed Mar 11, 2024
1 parent c4e0fd7 commit cc82f26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2268,8 +2268,9 @@ impl Context {

// We can omit the element size array for arrays which don't contain arrays or slices.
fn can_omit_element_sizes_array(array_typ: &Type) -> bool {
let (Type::Array(types, _) | Type::Slice(types)) = array_typ else {
panic!("ICE: expected array type");
let types = match array_typ {
Type::Array(types, _) | Type::Slice(types) => types,
_ => panic!("ICE: expected array or slice type"),
};

!types.iter().any(|typ| typ.contains_an_array())
Expand Down

0 comments on commit cc82f26

Please sign in to comment.