From 9569e24a062fa250ae08ff58ea0db5bc94ab8a4d Mon Sep 17 00:00:00 2001 From: Max Ammann Date: Mon, 24 May 2021 13:54:51 +0200 Subject: [PATCH] Remove unused HasRand to avoid confusion with libafl::state::HasRand (#120) --- libafl/src/bolts/rands.rs | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/libafl/src/bolts/rands.rs b/libafl/src/bolts/rands.rs index 0058d6f941..b53794f494 100644 --- a/libafl/src/bolts/rands.rs +++ b/libafl/src/bolts/rands.rs @@ -1,4 +1,4 @@ -use core::{cell::RefCell, debug_assert, fmt::Debug}; +use core::{debug_assert, fmt::Debug}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use xxhash_rust::xxh3::xxh3_64_with_seed; @@ -74,31 +74,6 @@ pub trait Rand: Debug + Serialize + DeserializeOwned { } } -/// Has a Rand field, that can be used to get random values -pub trait HasRand -where - R: Rand, -{ - /// Get the hold [`RefCell`] Rand instance - fn rand(&self) -> &RefCell; - - /// Gets the next 64 bit value - fn rand_next(&mut self) -> u64 { - self.rand().borrow_mut().next() - } - /// Gets a value below the given 64 bit val (inclusive) - fn rand_below(&mut self, upper_bound_excl: u64) -> u64 { - self.rand().borrow_mut().below(upper_bound_excl) - } - - /// Gets a value between the given lower bound (inclusive) and upper bound (inclusive) - fn rand_between(&mut self, lower_bound_incl: u64, upper_bound_incl: u64) -> u64 { - self.rand() - .borrow_mut() - .between(lower_bound_incl, upper_bound_incl) - } -} - // helper macro for deriving Default macro_rules! default_rand { ($rand: ty) => {