Skip to content
Prev Previous commit
Next Next commit
Apply clippy and rustfmt
  • Loading branch information
moreal committed Feb 17, 2026
commit 66cab2ca6bff97ff5b4e9e59c9dc1e45a5d3515a
63 changes: 26 additions & 37 deletions crates/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6624,34 +6624,33 @@ impl Compiler {
values: inner_values,
..
}) = value
&& inner_op != op
{
if inner_op != op {
let pop_block = self.new_block();
self.compile_bool_op_inner(inner_op, inner_values, Some(pop_block))?;
// Test the inner result for the outer BoolOp
emit!(self, Instruction::Copy { index: 1_u32 });
match op {
ast::BoolOp::And => {
emit!(
self,
Instruction::PopJumpIfFalse {
target: after_block,
}
);
}
ast::BoolOp::Or => {
emit!(
self,
Instruction::PopJumpIfTrue {
target: after_block,
}
);
}
let pop_block = self.new_block();
self.compile_bool_op_inner(inner_op, inner_values, Some(pop_block))?;
// Test the inner result for the outer BoolOp
emit!(self, Instruction::Copy { index: 1_u32 });
match op {
ast::BoolOp::And => {
emit!(
self,
Instruction::PopJumpIfFalse {
target: after_block,
}
);
}
ast::BoolOp::Or => {
emit!(
self,
Instruction::PopJumpIfTrue {
target: after_block,
}
);
}
self.switch_to_block(pop_block);
emit!(self, Instruction::PopTop);
continue;
}
self.switch_to_block(pop_block);
emit!(self, Instruction::PopTop);
continue;
}

self.compile_expression(value)?;
Expand Down Expand Up @@ -6707,20 +6706,10 @@ impl Compiler {
emit!(self, Instruction::Copy { index: 1_u32 });
match op {
ast::BoolOp::And => {
emit!(
self,
Instruction::PopJumpIfFalse {
target,
}
);
emit!(self, Instruction::PopJumpIfFalse { target });
}
ast::BoolOp::Or => {
emit!(
self,
Instruction::PopJumpIfTrue {
target,
}
);
emit!(self, Instruction::PopJumpIfTrue { target });
}
}

Expand Down