From 5fedf06646b6bc98fca50926ab1f5201bcb6778f Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Tue, 28 Mar 2023 19:14:18 +0200 Subject: [PATCH] Update lib.rs small simplification --- src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1b97f1d..073c1f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -604,11 +604,10 @@ macro_rules! impl_integer_for_isize { let separate_div_rem = (n / d, n % d); let combined_div_rem = n.div_rem(&d); + test_division_rule(nd, qr); + assert_eq!(separate_div_rem, qr); assert_eq!(combined_div_rem, qr); - - test_division_rule(nd, separate_div_rem); - test_division_rule(nd, combined_div_rem); } test_nd_dr((8, 3), (2, 2)); @@ -630,11 +629,10 @@ macro_rules! impl_integer_for_isize { (Integer::div_floor(&n, &d), Integer::mod_floor(&n, &d)); let combined_div_mod_floor = Integer::div_mod_floor(&n, &d); + test_division_rule(nd, dm); + assert_eq!(separate_div_mod_floor, dm); assert_eq!(combined_div_mod_floor, dm); - - test_division_rule(nd, separate_div_mod_floor); - test_division_rule(nd, combined_div_mod_floor); } test_nd_dm((8, 3), (2, 2));