We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db2775a commit 7fa003bCopy full SHA for 7fa003b
stdlib/src/opcode.rs
@@ -54,13 +54,8 @@ mod opcode {
54
})
55
.unwrap_or(Ok(false))?;
56
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
- })
+ let opcode = args.opcode.try_to_primitive::<u8>(vm)?;
+ let instruction = Instruction::try_from(opcode)
64
.map_err(|_| vm.new_value_error("invalid opcode or oparg"))?;
65
66
Ok(instruction.stack_effect(oparg.into(), jump))
0 commit comments