From 6ddf291db3e0d630d7650f37bb7af313df937790 Mon Sep 17 00:00:00 2001 From: Pufferfish101007 <50246616+pufferfish101007@users.noreply.github.com> Date: Sat, 16 Mar 2024 15:52:24 +0000 Subject: [PATCH] lint again --- src/ir.rs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/ir.rs b/src/ir.rs index 0216985..f88882f 100644 --- a/src/ir.rs +++ b/src/ir.rs @@ -533,7 +533,7 @@ impl InputType { pub fn least_restrictive_concrete_type(&self) -> InputType { match self.base_type() { InputType::Union(a, _) => a.least_restrictive_concrete_type(), - other => other.clone(), + other => other, } } @@ -1392,7 +1392,7 @@ impl IrBlockVec for Vec { IrOpcode::operator_lt, ] .into_iter() - .chain(condition_opcodes.clone().into_iter()) + .chain(condition_opcodes.into_iter()) { opcodes.push(IrBlock::new_with_stack_no_cast( op, @@ -1621,17 +1621,21 @@ impl IrBlockVec for Vec { .rposition(|b| b.type_stack.len() == type_stack.len() - j) .ok_or(make_hq_bug!(""))?; let cast_stack = self.get_type_stack(Some(cast_pos)); + #[allow(clippy::let_and_return)] let cast_block = IrBlock::new_with_stack_no_cast( IrOpcode::hq_cast( - cast_stack - .borrow() - .clone() - .ok_or(make_hq_bug!( - "tried to cast to {:?} from empty type stack at {:?}", - cast_type.clone(), - op - ))? - .1, + { + let from = cast_stack + .borrow() + .clone() + .ok_or(make_hq_bug!( + "tried to cast to {:?} from empty type stack at {:?}", + cast_type.clone(), + op + ))? + .1; + from + }, cast_type.clone(), ), cast_stack, @@ -1691,7 +1695,7 @@ pub fn step_from_top_block<'a>( { next_id = last_nexts.pop(); } else { - next_id.clone_from(next_block.block_info().ok_or(make_hq_bug!(""))?.next); + next_id.clone_from(&next_block.block_info().ok_or(make_hq_bug!(""))?.next); } if ops.is_empty() { hq_bug!("assertion failed: !ops.is_empty()")