mild borrow_mut cleanup

This commit is contained in:
Dominik Maier 2020-11-06 02:46:36 +01:00
parent 6ceb02be17
commit f13e680ee0
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ where
}
let idx;
{
idx = self.rand().borrow_mut().below(count) as usize;
idx = self.rand_below(count) as usize;
}
self.mutation_by_idx(idx)
}
@ -180,7 +180,7 @@ where
M: Mutator<I>,
I: Input + HasBytesVec,
{
let bit = mutator.rand().borrow_mut().below(input.bytes().len() as u64) as usize;
let bit = mutator.rand_below(input.bytes().len() as u64) as usize;
input.bytes_mut()[bit >> 3] ^= (128 >> (bit & 7)) as u8;
Ok(())
}

View File

@ -24,7 +24,7 @@ where
}
fn iterations(&mut self) -> usize {
1 + self.rand().borrow_mut().below(128) as usize
1 + self.rand_below(128) as usize
}
fn perform_mutational(&mut self, entry: Rc<RefCell<Testcase<I>>>) -> Result<(), AflError> {