diff --git a/hercules_cg/src/gpu.rs b/hercules_cg/src/gpu.rs index f3b38878b9739eb7cb2a3a14fbbb6606a731877e..01ca4773907c19fd536c0eb3034095baffbb7309 100644 --- a/hercules_cg/src/gpu.rs +++ b/hercules_cg/src/gpu.rs @@ -1767,23 +1767,21 @@ extern \"C\" {} {}(", Index::Field(field) => { index_ptr.push_str(&format!( " + ({})", - self.get_size(type_id, Some(*field), Some(extra_dim_collects)))); - type_id = - if let Type::Product(fields) = - &self.types[type_id.idx()] { - fields[*field] - } else { - panic!("Expected product type") - }; + self.get_size(type_id, Some(*field), Some(extra_dim_collects)) + )); + type_id = if let Type::Product(fields) = &self.types[type_id.idx()] { + fields[*field] + } else { + panic!("Expected product type") + }; } // Variants of summations have zero offset Index::Variant(index) => { - type_id = - if let Type::Summation(variants) = &self.types[type_id.idx()] { - variants[*index] - } else { - panic!("Expected summation type") - }; + type_id = if let Type::Summation(variants) = &self.types[type_id.idx()] { + variants[*index] + } else { + panic!("Expected summation type") + }; } // Convert multi-d array index to 1-d index, and optionally // convert to single-byte index by multiplying by element size @@ -1792,9 +1790,7 @@ extern \"C\" {} {}(", if has_extra_dim { continue; } - let Type::Array(element_type, extents) = - &self.types[type_id.idx()] - else { + let Type::Array(element_type, extents) = &self.types[type_id.idx()] else { panic!("Expected array type") }; let mut cumulative_offset = multiply_dcs(&extents[array_indices.len()..]);