Skip to content

Commit 7fa003b

Browse files
committed
Apply coderabbit suggestion
1 parent db2775a commit 7fa003b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

stdlib/src/opcode.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,8 @@ mod opcode {
5454
})
5555
.unwrap_or(Ok(false))?;
5656

57-
let instruction = args
58-
.opcode
59-
.try_to_primitive::<u8>(vm)
60-
.and_then(|v| {
61-
Instruction::try_from(v)
62-
.map_err(|_| vm.new_exception_empty(vm.ctx.exceptions.value_error.to_owned()))
63-
})
57+
let opcode = args.opcode.try_to_primitive::<u8>(vm)?;
58+
let instruction = Instruction::try_from(opcode)
6459
.map_err(|_| vm.new_value_error("invalid opcode or oparg"))?;
6560

6661
Ok(instruction.stack_effect(oparg.into(), jump))

0 commit comments

Comments
 (0)