Skip to content

Commit

Permalink
Rename BoolMutator to BoolInvertMutator
Browse files Browse the repository at this point in the history
  • Loading branch information
riesentoaster committed Feb 3, 2025
1 parent 6243b68 commit 4d25755
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libafl/src/mutators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,20 +408,20 @@ impl Named for NopMutator {
}
}

/// [`Mutator`] that flips a boolean value.
/// [`Mutator`] that inverts a boolean value.
///
/// Mostly useful in combination with [`mapping::MappingMutator`]s.
/// Mostly useful in combination with [`mapping::MappingMutator`]s to mutate parts of a complex input.
#[derive(Debug)]
pub struct BoolMutator;
pub struct BoolInvertMutator;

impl<S> Mutator<bool, S> for BoolMutator {
impl<S> Mutator<bool, S> for BoolInvertMutator {
fn mutate(&mut self, _state: &mut S, input: &mut bool) -> Result<MutationResult, Error> {
*input = !*input;
Ok(MutationResult::Mutated)
}
}

impl Named for BoolMutator {
impl Named for BoolInvertMutator {
fn name(&self) -> &Cow<'static, str> {
&Cow::Borrowed("BoolMutator")
}
Expand Down

0 comments on commit 4d25755

Please sign in to comment.