From 1469ed68d16bcaa069965dcecf4cab0dbcde3b92 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 3 Sep 2021 09:52:50 -0700 Subject: [PATCH] Fix div_ceil with rand and serde too --- src/bigrand.rs | 2 +- src/biguint/serde.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bigrand.rs b/src/bigrand.rs index cb440327..8f0ce5b3 100644 --- a/src/bigrand.rs +++ b/src/bigrand.rs @@ -66,7 +66,7 @@ impl RandBigInt for R { let len = (digits + (rem > 0) as u64) .to_usize() .expect("capacity overflow"); - let native_digits = bit_size.div_ceil(&64); + let native_digits = Integer::div_ceil(&bit_size, &64); let native_len = native_digits.to_usize().expect("capacity overflow"); let mut data = vec![0u64; native_len]; unsafe { diff --git a/src/biguint/serde.rs b/src/biguint/serde.rs index 573b0a7b..ed663c6d 100644 --- a/src/biguint/serde.rs +++ b/src/biguint/serde.rs @@ -89,7 +89,7 @@ impl<'de> Visitor<'de> for U32Visitor { use num_integer::Integer; let u32_len = seq.size_hint().unwrap_or(0); - let len = u32_len.div_ceil(&2); + let len = Integer::div_ceil(&u32_len, &2); let mut data = Vec::with_capacity(len); while let Some(lo) = seq.next_element::()? {