Skip to content

Commit

Permalink
cleanup: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nerodesu017 committed Jul 1, 2024
1 parent 999d969 commit 153a0c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/execution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ impl<'b> RuntimeInstance<'b> {
let divisor = divisor as u32;

if dividend == 0 {
return Err(crate::Error::RuntimeError(
crate::core::error::RuntimeError::DivideBy0,
));
return Err(crate::Error::RuntimeError(
crate::core::error::RuntimeError::DivideBy0,
));
}

let res = (divisor / dividend) as i32;
Expand Down
3 changes: 0 additions & 3 deletions tests/arithmetic/division.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ pub fn division_signed_panic_result_unrepresentable() {
);
}


/// A simple function to test unsigned division
#[test_log::test]
pub fn division_unsigned_simple() {
Expand All @@ -106,13 +105,11 @@ pub fn division_unsigned_simple() {
assert_eq!(9_001, instance.invoke_func(0, (81_018_001, 9_001)).unwrap());
assert_eq!(0, instance.invoke_func(0, (i32::MIN, -1)).unwrap());


assert_eq!(0, instance.invoke_func(0, (i32::MIN, -1)).unwrap());
assert_eq!(-20, instance.invoke_func(0, (-20, 1)).unwrap());
assert_eq!(2147483638, instance.invoke_func(0, (-20, 2)).unwrap());
assert_eq!(1431655758, instance.invoke_func(0, (-20, 3)).unwrap());
assert_eq!(1073741819, instance.invoke_func(0, (-20, 4)).unwrap());

}

/// A simple function to test unsigned division's RuntimeError when dividing by 0
Expand Down

0 comments on commit 153a0c8

Please sign in to comment.