From 0bcb002196608df2eaee972ebbb348bcd9f57e90 Mon Sep 17 00:00:00 2001 From: Antonio Sarosi Date: Mon, 2 Dec 2024 00:25:20 +0000 Subject: [PATCH] Remove unnecessary destructuring --- engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs b/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs index fefb534c5..07cc068d8 100644 --- a/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs +++ b/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs @@ -108,10 +108,8 @@ impl IRHelper for IntermediateRepr { fn find_function<'a>(&'a self, function_name: &str) -> Result> { match self.walk_functions().find(|f| f.name() == function_name) { - Some(f) => { - let repr::Function { .. } = f.item.elem; - Ok(f) - } + Some(f) => Ok(f), + None => { // Get best match. let functions = self.walk_functions().map(|f| f.name()).collect::>();