diff --git a/bounded-collections/src/bounded_btree_map.rs b/bounded-collections/src/bounded_btree_map.rs index 248d72e3..319e5836 100644 --- a/bounded-collections/src/bounded_btree_map.rs +++ b/bounded-collections/src/bounded_btree_map.rs @@ -243,7 +243,7 @@ where Ok(BoundedBTreeMap::::unchecked_from( self.0 .into_iter() - .map(|(k, v)| (f((&k, v)).map(|t| (k, t)))) + .map(|(k, v)| f((&k, v)).map(|t| (k, t))) .collect::, _>>()?, )) } diff --git a/uint/src/uint.rs b/uint/src/uint.rs index 3482aa6d..96f0e7ca 100644 --- a/uint/src/uint.rs +++ b/uint/src/uint.rs @@ -938,10 +938,10 @@ macro_rules! construct_uint { (q, remainder) } - // Returns the least number of words needed to represent the nonzero number + /// Returns the least number of words needed to represent a number with width `bits`. fn words(bits: usize) -> usize { debug_assert!(bits > 0); - 1 + (bits - 1) / Self::WORD_BITS + bits.div_ceil(Self::WORD_BITS) } /// Returns a pair `(self / other, self % other)`. diff --git a/uint/tests/uint_tests.rs b/uint/tests/uint_tests.rs index 5a89bcae..f9ffb013 100644 --- a/uint/tests/uint_tests.rs +++ b/uint/tests/uint_tests.rs @@ -7,7 +7,6 @@ // except according to those terms. use core::{convert::TryInto, str::FromStr, u64::MAX}; -use crunchy::unroll; use uint::{construct_uint, overflowing, FromDecStrErr}; construct_uint! {