From 8796e8c921efb8b5981b2184a3bfc9ded54832ee Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:50:38 -0800 Subject: [PATCH] clippy --- compiler/passes/src/code_generation/visit_expressions.rs | 4 ++-- compiler/passes/src/destructuring/destructure_statement.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/passes/src/code_generation/visit_expressions.rs b/compiler/passes/src/code_generation/visit_expressions.rs index 88d440406d..7c22e68a35 100644 --- a/compiler/passes/src/code_generation/visit_expressions.rs +++ b/compiler/passes/src/code_generation/visit_expressions.rs @@ -540,8 +540,8 @@ impl<'a> CodeGenerator<'a> { Some(program) => program, None => { let stub_program = self.program.stubs.get(&program_name); - if stub_program.is_some() { - stub_scope = ProgramScope::from(stub_program.unwrap().clone()); + if let Some(stub_program_unwrapped) = stub_program { + stub_scope = ProgramScope::from(stub_program_unwrapped.clone()); &stub_scope } else { unreachable!("Type checking guarantees that imported and stub programs are well defined.") diff --git a/compiler/passes/src/destructuring/destructure_statement.rs b/compiler/passes/src/destructuring/destructure_statement.rs index 8d7189ce74..c5cd99cd92 100644 --- a/compiler/passes/src/destructuring/destructure_statement.rs +++ b/compiler/passes/src/destructuring/destructure_statement.rs @@ -173,7 +173,7 @@ impl StatementReconstructor for Destructurer<'_> { let statements = lhs_tuple .elements .into_iter() - .zip_eq(rhs_tuple.elements.into_iter()) + .zip_eq(rhs_tuple.elements) .map(|(lhs, rhs)| { // Get the type of the rhs. let type_ = match self.type_table.get(&lhs.id()) {