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:
    ACK 3e19983aa0
  sanket1729:
    cr ACK 3e19983aa0

Tree-SHA512: 60555da91e3c3053206b8c22c5b45f843b2f0fdfbfe46ff324c6ba49f64339447acd551991baecad2f411415f0ee7c50400df3f08465d8150bad264c50ed6c5d
This commit is contained in:
sanket1729 2021-12-15 14:23:28 +05:30
commit b3cd308447
No known key found for this signature in database
GPG Key ID: 648FFB183E0870A2
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 {