Skip to content

Commit cc6a5c3

Browse files
committed
Update rand to 0.9, fix a bunch of clippy
1 parent 68f6657 commit cc6a5c3

File tree

15 files changed

+179
-145
lines changed

15 files changed

+179
-145
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,5 @@ ASALocalRun/
335335
# MFractors (Xamarin productivity tool) working folder
336336
.mfractor/
337337
.DS_Store
338+
339+
.vscode

Cargo.lock

Lines changed: 56 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lain/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ keywords.workspace = true
99
license.workspace = true
1010

1111
[dependencies]
12-
rand = { version = "0.8", features = ["small_rng"] }
12+
rand = { version = "0.9", features = ["small_rng"] }
1313
byteorder = "1.2"
1414
paste = "1.0"
1515
lain_derive = { version = "0.5", path = "../lain_derive" }

lain/src/dangerous_numbers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ macro_rules! dangerous_number {
6363
( $ty:ident, $nums:ident ) => {
6464
impl DangerousNumber<$ty> for $ty {
6565
fn select_dangerous_number<R: Rng>(rng: &mut R) -> $ty {
66-
return $nums[rng.gen_range(0..$nums.len())] as $ty;
66+
return $nums[rng.random_range(0..$nums.len())] as $ty;
6767
}
6868

6969
fn dangerous_number_at_index(idx: usize) -> $ty {

lain/src/driver.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,16 @@ impl<T: 'static + Send + Sync> FuzzerDriver<T> {
198198
/// ```compile_fail
199199
/// fn iteration_routine<R: Rng>(mutator: &mut Mutator<R>, thread_context: &mut FuzzerThreadContext, _global_context: Option<Arc<RwLock<GlobalContext>>>) -> Result<(), ()>
200200
/// ```
201-
pub fn start_fuzzer<F: 'static, C: 'static, T: 'static + Send + Sync>(
202-
driver: Arc<FuzzerDriver<T>>,
203-
callback: F,
204-
) where
201+
pub fn start_fuzzer<F, C, T>(driver: Arc<FuzzerDriver<T>>, callback: F)
202+
where
205203
F: Fn(&mut Mutator<StdRng>, &mut C, Option<Arc<RwLock<T>>>) -> Result<(), ()>
206204
+ std::marker::Send
207205
+ std::marker::Sync
208206
+ Copy,
209207
C: Default,
208+
F: 'static,
209+
C: 'static,
210+
T: 'static + Send + Sync,
210211
{
211212
let mut root_rng = StdRng::seed_from_u64(driver.seed());
212213

@@ -216,7 +217,7 @@ pub fn start_fuzzer<F: 'static, C: 'static, T: 'static + Send + Sync>(
216217
let thread_driver = driver.clone();
217218
let thread_name = format!("Fuzzer thread {}", i);
218219

219-
let thread_seed: u64 = root_rng.gen();
220+
let thread_seed: u64 = root_rng.random();
220221

221222
let join_handle = thread::Builder::new()
222223
.name(thread_name)

0 commit comments

Comments
 (0)