Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pufferfish101007 committed Sep 3, 2023
1 parent c80e413 commit b68f7dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ impl From<IrOpcode> for IrBlock {
let output = descriptor.output();
Self {
opcode,
actual_output: output.clone(),
expected_output: output.clone(),
actual_output: *output,
expected_output: *output,
}
}
}
Expand Down Expand Up @@ -545,10 +545,10 @@ impl IrBlockVec for Vec<IrBlock> {
let top_type = type_stack
.pop()
.expect("couldn't pop from type stack (E020)");
expected_outputs.push((top_type.0, block_type.clone()))
expected_outputs.push((top_type.0, *block_type))
}
if !matches!(op.opcode().descriptor().output(), BlockType::Stack) {
type_stack.push((index, (*op.opcode().descriptor().output()).clone()));
type_stack.push((index, (*op.opcode().descriptor().output())));
}
}
assert!(
Expand All @@ -560,7 +560,7 @@ impl IrBlockVec for Vec<IrBlock> {
for (index, ty) in expected_outputs {
self.get_mut(index)
.expect("ir block doesn't exist (E043)")
.set_expected_output(ty.clone());
.set_expected_output(ty);
}
}
fn add_inputs(
Expand Down Expand Up @@ -785,7 +785,7 @@ impl IrBlockVec for Vec<IrBlock> {
step_from_top_block(substack_id.clone(), vec![looper_id.clone()], blocks, Rc::clone(&context), steps, target_id.clone());
let mut opcodes = vec![];
opcodes.add_inputs(&block_info.inputs, blocks, Rc::clone(&context), steps, target_id.clone());
opcodes.append(&mut condition_opcodes.clone());
opcodes.append(&mut condition_opcodes);
opcodes.fixup_types();
steps.insert((target_id.clone(), block_id.clone()), Step::new(opcodes.clone(), Rc::clone(&context)));
vec![
Expand All @@ -795,7 +795,7 @@ impl IrBlockVec for Vec<IrBlock> {
IrOpcode::math_number { NUM: 0.0.into() },
IrOpcode::operator_equals,
IrOpcode::hq_goto_if { step: Some((target_id.clone(), block_info.next.clone().unwrap())), does_yield: true },
IrOpcode::hq_goto { step: Some((target_id.clone(), substack_id.clone())), does_yield: false },
IrOpcode::hq_goto { step: Some((target_id, substack_id)), does_yield: false },
]
}
BlockOpcode::control_repeat_until => {
Expand All @@ -816,12 +816,12 @@ impl IrBlockVec for Vec<IrBlock> {
step_from_top_block(substack_id.clone(), vec![looper_id], blocks, Rc::clone(&context), steps, target_id.clone());
let mut opcodes = vec![];
opcodes.add_inputs(&block_info.inputs, blocks, Rc::clone(&context), steps, target_id.clone());
opcodes.append(&mut condition_opcodes.clone());
opcodes.append(&mut condition_opcodes);
opcodes.fixup_types();
steps.insert((target_id.clone(), block_id.clone()), Step::new(opcodes.clone(), Rc::clone(&context)));
vec![
IrOpcode::hq_goto_if { step: Some((target_id.clone(), block_info.next.clone().unwrap())), does_yield: true },
IrOpcode::hq_goto { step: Some((target_id.clone(), substack_id.clone())), does_yield: false },
IrOpcode::hq_goto { step: Some((target_id, substack_id)), does_yield: false },
]
}
_ => todo!(),
Expand Down
4 changes: 2 additions & 2 deletions src/targets/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fn instructions(
use Instruction::*;
use IrBlockType::*;
use IrOpcode::*;
let expected_output = op.expected_output().clone();
let mut actual_output = op.actual_output().clone();
let expected_output = *op.expected_output();
let mut actual_output = *op.actual_output();
let mut instructions = match &op.opcode() {
looks_think => {
if context.dbg {
Expand Down

0 comments on commit b68f7dc

Please sign in to comment.