Skip to content

Commit

Permalink
Fix div_ceil with rand and serde too
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Sep 3, 2021
1 parent 22940ca commit 1469ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bigrand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<R: Rng + ?Sized> 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 {
Expand Down
2 changes: 1 addition & 1 deletion src/biguint/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u32>()? {
Expand Down

0 comments on commit 1469ed6

Please sign in to comment.