add helpful message to division-by-zero panic

This commit is contained in:
z8674558 2021-12-15 01:50:56 +09:00
parent ed40f3d3a6
commit 3e19983aa0
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ macro_rules! construct_uint {
let your_bits = other.bits(); let your_bits = other.bits();
// Check for division by 0 // Check for division by 0
assert!(your_bits != 0); assert!(your_bits != 0, "attempted to divide {} by zero", self);
// Early return in case we are dividing by a larger number than us // Early return in case we are dividing by a larger number than us
if my_bits < your_bits { if my_bits < your_bits {