We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e9b9a5 commit ff71feaCopy full SHA for ff71fea
1 file changed
benches/tree_reduce.rs
@@ -12,8 +12,8 @@ trait IterEx: Iterator {
12
Self: Sized,
13
{
14
let hint = self.size_hint().0;
15
- let cap = std::mem::size_of::<usize>() * 8 - hint.leading_zeros() as usize;
16
- let mut stack = Vec::with_capacity(cap);
+ let capacity = usize::BITS - hint.leading_zeros();
+ let mut stack = Vec::with_capacity(capacity as usize);
17
self.enumerate().for_each(|(mut i, mut x)| {
18
while (i & 1) != 0 {
19
x = f(stack.pop().unwrap(), x);
0 commit comments