Skip to content

Commit

Permalink
✏️ review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacan authored and Ikrk committed Feb 8, 2024
1 parent 710ba99 commit 98caeb2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/client/src/test_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,13 @@ impl TestGenerator {
} else {
let mut directories: std::collections::HashSet<_> = fuzz_dir_path
.read_dir()
.unwrap()
.map(|r| r.unwrap().file_name().to_str().unwrap().to_string())
.expect("Reading directory failed")
.map(|r| {
r.expect("Reading directory; DirEntry error")
.file_name()
.to_string_lossy()
.to_string()
})
.collect();

// INFO discard known entries created by framework, everything else
Expand All @@ -226,7 +231,7 @@ impl TestGenerator {
let mut fuzz_id = directories.len();
loop {
let fuzz_test = format!("fuzz_{fuzz_id}");
if directories.contains(&fuzz_test) {
if directories.contains(&fuzz_test) && fuzz_id < usize::MAX {
fuzz_id += 1;
} else {
break fuzz_id;
Expand Down

0 comments on commit 98caeb2

Please sign in to comment.