Skip to content

Commit

Permalink
Use ResOperand.into. (starkware-libs#2796)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyalesokhin-starkware authored Apr 13, 2023
1 parent fe425d0 commit 48f07a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/cairo-lang-casm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl CasmBuilder {
inputs.map(|v| match self.get_value(v, true) {
CellExpression::Deref(cell) => ResOperand::Deref(cell),
CellExpression::DoubleDeref(cell, offset) => ResOperand::DoubleDeref(cell, offset),
CellExpression::Immediate(imm) => ResOperand::Immediate(imm.into()),
CellExpression::Immediate(imm) => imm.into(),
CellExpression::BinOp { op, a: other, b } => match op {
CellOperator::Add => {
ResOperand::BinOp(BinOpOperand { op: Operation::Add, a: other, b })
Expand Down Expand Up @@ -341,9 +341,7 @@ impl CasmBuilder {
/// Increases AP by `size`.
pub fn add_ap(&mut self, size: usize) {
let instruction = self.get_instruction(
InstructionBody::AddAp(AddApInstruction {
operand: ResOperand::Immediate(BigInt::from(size).into()),
}),
InstructionBody::AddAp(AddApInstruction { operand: BigInt::from(size).into() }),
false,
);
self.statements.push(Statement::Final(instruction));
Expand Down

0 comments on commit 48f07a4

Please sign in to comment.