diff options
author | Dominik Maier <domenukk@gmail.com> | 2021-02-27 15:52:36 +0100 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2021-02-27 15:52:36 +0100 |
commit | c219502f0fe654927c3f74f9791f786f0740f344 (patch) | |
tree | f6960facbd01bf0573199a9320aeb94a32653f1b /custom_mutators/rust/example/src | |
parent | a5da9ce42cab1eab93cf80ca744944ae26e6ab58 (diff) | |
download | afl++-c219502f0fe654927c3f74f9791f786f0740f344.tar.gz |
some rust cleanup
Diffstat (limited to 'custom_mutators/rust/example/src')
-rw-r--r-- | custom_mutators/rust/example/src/example_mutator.rs (renamed from custom_mutators/rust/example/src/lib.rs) | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/custom_mutators/rust/example/src/lib.rs b/custom_mutators/rust/example/src/example_mutator.rs index 4f9345c0..9b9d4997 100644 --- a/custom_mutators/rust/example/src/lib.rs +++ b/custom_mutators/rust/example/src/example_mutator.rs @@ -1,14 +1,13 @@ #![allow(unused_variables)] use custom_mutator::{export_mutator, CustomMutator}; -use std::os::raw::c_uint; struct ExampleMutator; impl CustomMutator for ExampleMutator { type Error = (); - fn init(seed: c_uint) -> Result<Self, ()> { + fn init(seed: u32) -> Result<Self, Self::Error> { Ok(Self) } @@ -17,7 +16,7 @@ impl CustomMutator for ExampleMutator { buffer: &'b mut [u8], add_buff: Option<&[u8]>, max_size: usize, - ) -> Result<Option<&'b [u8]>, ()> { + ) -> Result<Option<&'b [u8]>, Self::Error> { buffer.reverse(); Ok(Some(buffer)) } @@ -30,7 +29,7 @@ struct OwnBufferExampleMutator { impl CustomMutator for OwnBufferExampleMutator { type Error = (); - fn init(seed: c_uint) -> Result<Self, ()> { + fn init(seed: u32) -> Result<Self, Self::Error> { Ok(Self { own_buffer: Vec::new(), }) |