Skip to content

Commit

Permalink
feat: convert from i32 to NumberOfWords
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Mar 14, 2024
1 parent 30954a6 commit b1fe8e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions triton-vm/src/op_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ impl TryFrom<u32> for NumberOfWords {
}
}

impl TryFrom<i32> for NumberOfWords {
type Error = NumberOfWordsError;

fn try_from(index: i32) -> NumWordsResult<Self> {
usize::try_from(index)?.try_into()
}
}

impl TryFrom<OpStackElement> for NumberOfWords {
type Error = NumberOfWordsError;

Expand Down

0 comments on commit b1fe8e0

Please sign in to comment.