Implement HasBytesConverter for NopFuzzer (#3239)

This commit is contained in:
lazymio 2025-05-16 19:31:15 +08:00 committed by GitHub
parent 7a9cca9e1b
commit 8c0ee046cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 3 deletions

View File

@ -1150,13 +1150,17 @@ where
/// A [`NopFuzzer`] that does nothing
#[derive(Clone, Debug)]
pub struct NopFuzzer {}
pub struct NopFuzzer {
converter: NopBytesConverter,
}
impl NopFuzzer {
/// Creates a new [`NopFuzzer`]
#[must_use]
pub fn new() -> Self {
Self {}
Self {
converter: NopBytesConverter::default(),
}
}
}
@ -1166,6 +1170,17 @@ impl Default for NopFuzzer {
}
}
impl HasBytesConverter for NopFuzzer {
type Converter = NopBytesConverter;
fn converter(&self) -> &Self::Converter {
&self.converter
}
fn converter_mut(&mut self) -> &mut Self::Converter {
&mut self.converter
}
}
impl<E, EM, I, S, ST> Fuzzer<E, EM, I, S, ST> for NopFuzzer
where
EM: ProgressReporter<S>,

View File

@ -298,7 +298,7 @@ impl ResizableMutator<u8> for &mut Vec<u8> {
}
}
#[derive(Debug, Default)]
#[derive(Debug, Clone, Copy, Default)]
/// Basic `NopBytesConverter` with just one type that is not converting
pub struct NopBytesConverter {}