Rename BoolMutator to BoolInvertMutator (#2929)

* Rename BoolMutator to BoolInvertMutator

* Fix name of BoolInvertMutator
This commit is contained in:
Valentin Huber 2025-02-03 13:33:39 +01:00 committed by GitHub
parent 6243b684f8
commit 500e01816d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -408,21 +408,21 @@ 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)] #[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> { fn mutate(&mut self, _state: &mut S, input: &mut bool) -> Result<MutationResult, Error> {
*input = !*input; *input = !*input;
Ok(MutationResult::Mutated) Ok(MutationResult::Mutated)
} }
} }
impl Named for BoolMutator { impl Named for BoolInvertMutator {
fn name(&self) -> &Cow<'static, str> { fn name(&self) -> &Cow<'static, str> {
&Cow::Borrowed("BoolMutator") &Cow::Borrowed("BoolInvertMutator")
} }
} }