Merge rust-bitcoin/rust-bitcoin#743: add helpful message to division-by-zero panic
3e19983aa0
add helpful message to division-by-zero panic (z8674558) Pull request description: Closes https://github.com/rust-bitcoin/rust-bitcoin/issues/739 ACKs for top commit: Kixunil: ACK3e19983aa0
sanket1729: cr ACK3e19983aa0
Tree-SHA512: 60555da91e3c3053206b8c22c5b45f843b2f0fdfbfe46ff324c6ba49f64339447acd551991baecad2f411415f0ee7c50400df3f08465d8150bad264c50ed6c5d
This commit is contained in:
commit
b3cd308447
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue