Skip to content

Commit 1f19cce

Browse files
committed
add Decode impl for OpCode
1 parent 6f8c520 commit 1f19cce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/ir2/src/decode/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use crate::{
3535
BranchOffset,
3636
FixedSlotSpan,
3737
Offset16,
38+
OpCode,
3839
Sign,
3940
Slot,
4041
SlotSpan,
@@ -123,6 +124,9 @@ impl_decode_using! {
123124
TrapCode as u8 = |code: u8| -> TrapCode {
124125
TrapCode::try_from(code).unwrap_unchecked()
125126
},
127+
OpCode as u16 = |code: u16| -> OpCode {
128+
OpCode::try_from(code).unwrap_unchecked()
129+
}
126130
}
127131

128132
impl<const N: usize, T: Decode> Decode for [T; N] {

0 commit comments

Comments
 (0)