From af8ca018b416bd4a1ba248b7665a5072e4b5c2f9 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Wed, 4 Dec 2024 13:36:24 -0600 Subject: [PATCH] Clippy --- compiler/noirc_evaluator/src/ssa/ir/types.rs | 4 ++-- compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/ir/types.rs b/compiler/noirc_evaluator/src/ssa/ir/types.rs index 06b20a0ea70..4e4f7e8aa62 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/types.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/types.rs @@ -191,11 +191,11 @@ impl Type { } /// Retrieves the array or slice type within this type, or panics if there is none. - pub(crate) fn into_contained_array(&self) -> &Type { + pub(crate) fn get_contained_array(&self) -> &Type { match self { Type::Numeric(_) | Type::Function => panic!("Expected an array type"), Type::Array(_, _) | Type::Slice(_) => self, - Type::Reference(element) => element.into_contained_array(), + Type::Reference(element) => element.get_contained_array(), } } diff --git a/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs b/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs index a880a7d15ea..b76c5e0df34 100644 --- a/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs +++ b/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs @@ -932,10 +932,10 @@ impl<'a> FunctionContext<'a> { if element.contains_an_array() { // If we haven't already seen this array type, the value may be possibly // aliased, so issue an inc_rc for it. - if !seen_array_types.insert(element.into_contained_array().clone()) { - if self.builder.increment_array_reference_count(parameter) { - incremented.insert(parameter); - } + if !seen_array_types.insert(element.get_contained_array().clone()) + && self.builder.increment_array_reference_count(parameter) + { + incremented.insert(parameter); } } }