Skip to content

Commit

Permalink
Remove percent field in config (#20)
Browse files Browse the repository at this point in the history
Signed-off-by: AsterNighT <[email protected]>
  • Loading branch information
AsterNighT authored Feb 24, 2021
1 parent c6248aa commit ab6be76
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion config-examples/mistake-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"mistake":
{
"filling":"zero",
"percent":100,
"maxOccurrences":1,
"maxLength":10
},
Expand Down
1 change: 0 additions & 1 deletion src/injector/injector_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ pub struct MistakeConfig {
pub filling: MistakeType,
pub max_length: usize,
pub max_occurrences: usize,
pub percent: usize
}

#[derive(Serialize, Deserialize, Clone, Debug)]
Expand Down
3 changes: 0 additions & 3 deletions src/injector/mistake_injector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ impl MistakeInjector {
let mut rng = rand::thread_rng();
let data_length = data.len();
let mistake = &self.mistake;
if rng.gen_range(0, 100) >= mistake.percent {
return Ok(());
}
let occurrence = match mistake.max_occurrences {
0 => 0,
mo => rng.gen_range(1, mo + 1),
Expand Down

0 comments on commit ab6be76

Please sign in to comment.