Skip to content

Commit

Permalink
apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed May 23, 2023
1 parent 4b3df45 commit 3b83ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/wasmi/src/engine/bytecode/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ impl BranchOffset {
fn make_err() -> TranslationError {
TranslationError::new(TranslationErrorInner::BranchOffsetOutOfBounds)
}
let src = src.into_u32() as i64;
let dst = dst.into_u32() as i64;
let src = i64::from(src.into_u32());
let dst = i64::from(dst.into_u32());
let offset = dst.checked_sub(src).ok_or_else(make_err)?;
let offset = i32::try_from(offset).map_err(|_| make_err())?;
Ok(Self(offset))
Expand Down

0 comments on commit 3b83ca1

Please sign in to comment.