diff --git a/fuzzers/baby_fuzzer_grimoire/src/main.rs b/fuzzers/baby_fuzzer_grimoire/src/main.rs index f403f52778..59aa1b956e 100644 --- a/fuzzers/baby_fuzzer_grimoire/src/main.rs +++ b/fuzzers/baby_fuzzer_grimoire/src/main.rs @@ -1,6 +1,6 @@ #[cfg(windows)] use std::ptr::write_volatile; -use std::{fs, io::Read, path::PathBuf,ptr::write}; +use std::{fs, io::Read, path::PathBuf, ptr::write}; use libafl::{ bolts::{current_nanos, rands::StdRand, tuples::tuple_list, AsSlice}, @@ -24,10 +24,10 @@ use libafl::{ /// Coverage map with explicit assignments due to the lack of instrumentation static mut SIGNALS: [u8; 16] = [0; 16]; -static mut SIGNALS_PTR: *mut u8=unsafe{SIGNALS.as_mut_ptr()}; +static mut SIGNALS_PTR: *mut u8 = unsafe { SIGNALS.as_mut_ptr() }; /// Assign a signal to the signals map fn signals_set(idx: usize) { - unsafe{write(SIGNALS_PTR.add(idx),1)}; + unsafe { write(SIGNALS_PTR.add(idx), 1) }; } fn is_sub(mut haystack: &[T], needle: &[T]) -> bool { @@ -82,7 +82,7 @@ pub fn main() { }; // Create an observation channel using the signals map - let observer=unsafe{StdMapObserver::from_mut_ptr("signals",SIGNALS_PTR,SIGNALS.len())}; + let observer = unsafe { StdMapObserver::from_mut_ptr("signals", SIGNALS_PTR, SIGNALS.len()) }; // Feedback to rate the interestingness of an input let mut feedback = MaxMapFeedback::tracking(&observer, false, true); diff --git a/fuzzers/push_stage_harness/src/main.rs b/fuzzers/push_stage_harness/src/main.rs index 58ca6b24c6..4dfc2be587 100644 --- a/fuzzers/push_stage_harness/src/main.rs +++ b/fuzzers/push_stage_harness/src/main.rs @@ -67,7 +67,7 @@ pub fn main() { let mgr = SimpleEventManager::new(monitor); // A queue policy to get testcasess from the corpus - let scheduler = QueueScheduler::new(); + let mut scheduler = QueueScheduler::new(); // Create the executor for an in-process function with just one observer //let mut executor = InProcessExecutor::new(&mut harness, &mut fuzzer, &mut state, &mut mgr) diff --git a/libafl/src/inputs/encoded.rs b/libafl/src/inputs/encoded.rs index ca4a666f8b..8cc679cf38 100644 --- a/libafl/src/inputs/encoded.rs +++ b/libafl/src/inputs/encoded.rs @@ -2,10 +2,10 @@ //! (As opposed to other, more abstract, inputs, like an Grammar-Based AST Input) //! See also [the paper on token-level fuzzing](https://www.usenix.org/system/files/sec21-salls.pdf) -#[cfg(feature = "std")] +#[cfg(feature = "regex")] use alloc::string::ToString; use alloc::{borrow::ToOwned, rc::Rc, string::String, vec::Vec}; -#[cfg(feature = "std")] +#[cfg(feature = "regex")] use core::str::from_utf8; use core::{ cell::RefCell, diff --git a/libafl/src/lib.rs b/libafl/src/lib.rs index f0b0ebcd12..4121e80e55 100644 --- a/libafl/src/lib.rs +++ b/libafl/src/lib.rs @@ -24,7 +24,7 @@ Welcome to `LibAFL` clippy::ptr_as_ptr, clippy::missing_panics_doc, clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, + clippy::module_name_repetitions )] #![cfg_attr(not(test), warn( missing_debug_implementations, diff --git a/libafl/src/monitors/mod.rs b/libafl/src/monitors/mod.rs index 9a590e5033..b104284661 100644 --- a/libafl/src/monitors/mod.rs +++ b/libafl/src/monitors/mod.rs @@ -317,14 +317,15 @@ impl Default for NopMonitor { } } -#[cfg(feature = "std")] /// Tracking monitor during fuzzing that just prints to `stdout`. +#[cfg(feature = "std")] #[derive(Debug, Clone)] pub struct SimplePrintingMonitor { start_time: Duration, client_stats: Vec, } +#[cfg(feature = "std")] impl Default for SimplePrintingMonitor { fn default() -> Self { Self {