Skip to content

Commit

Permalink
Fixes data_type.gen
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Jan 10, 2025
1 parent 34ef4c2 commit 35ae6f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arbitrator/tools/stylus_benchmark/src/scenarios/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ impl Rand for DataType {
fn gen(&self) -> usize {
let mut rng = rand::thread_rng();
match self {
// makes sure that the generated number fits a signed integer
DataType::I32 => (rng.gen::<u32>() / 2 - 1).try_into().unwrap(),
DataType::I64 => (rng.gen::<u64>() / 2 - 1).try_into().unwrap(),
DataType::I32 => rng.gen_range(0..i32::MAX).try_into().unwrap(),
DataType::I64 => rng.gen_range(0..i64::MAX).try_into().unwrap(),
}
}
}

0 comments on commit 35ae6f3

Please sign in to comment.