Skip to content

Commit bc2c6d4

Browse files
committed
Clippy+fmt
1 parent 86b6a38 commit bc2c6d4

File tree

7 files changed

+23
-32
lines changed

7 files changed

+23
-32
lines changed

fuzzers/frida_gdiplus/src/fuzzer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,7 @@ unsafe fn fuzz(options: &FuzzerOptions) -> Result<(), Error> {
424424
// New maximization map feedback linked to the reaches observer
425425
// TODO - check whether I need to track novelties as well
426426
// MaxMapFeedback::tracking(&reachability_observer, true, true),
427-
ReachabilityFeedback::new(
428-
&reachability_observer_meta
429-
),
427+
ReachabilityFeedback::new(&reachability_observer_meta),
430428
NewHashFeedbackWithStack::new(&bt_observer),
431429
CrashFeedback::new(),
432430
TimeoutFeedback::new()

fuzzers/toolbox/src/accum_observer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use alloc::borrow::Cow;
2-
32
#[cfg(unix)]
43
use std::fs;
54
use std::{
65
collections::HashMap,
7-
hash::{BuildHasher, Hasher},
6+
hash::{BuildHasher, Hash, Hasher},
87
path::PathBuf,
98
};
109

@@ -24,7 +23,6 @@ use libafl_targets::{
2423
};
2524
use rangemap::RangeMap;
2625
use serde::{Deserialize, Serialize};
27-
use std::hash::Hash;
2826
/// Map observer that accumulates hitcounts and saves them in DrCov format.
2927
///
3028
#[derive(Serialize, Deserialize, Clone, Debug)]

fuzzers/toolbox/src/crash_stack.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ use libafl::{
1212
observers::{BacktraceObserver, HarnessType, Observer, ObserverWithHashField, ObserversTuple},
1313
state::State,
1414
};
15-
use libafl_bolts::{impl_serdeany, Error, Named,
16-
tuples::{Handle, MatchNameRef}};
15+
use libafl_bolts::{
16+
impl_serdeany,
17+
tuples::{Handle, MatchNameRef},
18+
Error, Named,
19+
};
1720
use log::{info, warn};
1821
use serde::{
1922
// Serializer,
@@ -285,7 +288,7 @@ impl<'a> BacktraceObserverWithStack<'a> {
285288
backtrace_hash: &'a mut Option<u64>,
286289
harness_type: HarnessType,
287290
with_symbols: bool,
288-
) -> Self
291+
) -> Self
289292
where
290293
S: Into<Cow<'static, str>>,
291294
{
@@ -423,7 +426,6 @@ where
423426
.get(&self.0.observer_handle())
424427
.expect("A NewHashFeedbackWithStack needs a BacktraceObserverWithStack");
425428

426-
427429
match observer.get_backtrace() {
428430
// Performance problem here!
429431
Some(b) => testcase.add_metadata(BacktraceMetadata::new(b.clone())),
@@ -451,8 +453,7 @@ impl<'a, S> HasObserverHandle for NewHashFeedbackWithStack<'a, S> {
451453
}
452454
}
453455

454-
impl<'a, S> NewHashFeedbackWithStack<'a, S>
455-
{
456+
impl<'a, S> NewHashFeedbackWithStack<'a, S> {
456457
/// Returns a new [`NewHashFeedbackWithStack`].
457458
#[must_use]
458459
pub fn new(observer: &BacktraceObserverWithStack<'a>) -> Self {

fuzzers/toolbox/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ pub mod crash_stack;
33
pub mod reachability_rt;
44
#[doc(hidden)]
55
pub extern crate alloc;
6-

fuzzers/toolbox/src/reachability_rt.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ use libafl::{
2222
// state::HasMetadata,
2323
// Error,
2424
};
25-
use libafl_bolts::{HasLen, Named, tuples::{Handle, Handled, MatchNameRef}};
25+
use libafl_bolts::{
26+
tuples::{Handle, Handled, MatchNameRef},
27+
HasLen, Named,
28+
};
2629
use libafl_frida::helper::FridaRuntime;
2730
use rangemap::RangeMap;
2831
//use std::os::windows::ffi::OsStringExt;
@@ -289,12 +292,9 @@ pub struct ReachabilityObserver {
289292
impl ReachabilityObserver {
290293
/// Creates a new [`ReachabilityObserver`] with the given name.
291294
#[must_use]
292-
pub fn new<S>(
293-
observer_name: S,
294-
map: *mut u8,
295-
hooks_file: Option<&str>) -> Self
296-
where
297-
S: Into<Cow<'static, str>> + Clone,
295+
pub fn new<S>(observer_name: S, map: *mut u8, hooks_file: Option<&str>) -> Self
296+
where
297+
S: Into<Cow<'static, str>> + Clone,
298298
{
299299
log::info!("ReachabilityObserver created");
300300
let hooks = match hooks_file {
@@ -312,7 +312,7 @@ impl ReachabilityObserver {
312312
.enumerate()
313313
.map(|(idx, hook)| (idx, hook.api_name.clone()))
314314
.collect();
315-
315+
316316
Self {
317317
observer_name: observer_name.clone().into(),
318318
base: unsafe { StdMapObserver::from_mut_ptr(observer_name, map, MAP_SIZE) },
@@ -462,7 +462,6 @@ where
462462
.get(&self.o_ref)
463463
.expect("A ReachabilityFeedback needs a ReachabilityObserver");
464464

465-
466465
let invocations = observer.get_invocations();
467466
if !invocations.is_empty() {
468467
testcase.add_metadata(ReachabilityMetadata::new(invocations.clone()));
@@ -487,8 +486,7 @@ impl HasObserverHandle for ReachabilityFeedback {
487486
}
488487
}
489488

490-
impl ReachabilityFeedback
491-
{
489+
impl ReachabilityFeedback {
492490
/// Returns a new [`ReachabilityFeedback`].
493491
#[must_use]
494492
pub fn new(observer: &ReachabilityObserver) -> Self {

libafl/src/executors/hooks/windows.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,20 +356,16 @@ pub mod windows_exception_handler {
356356
// as we'll mostly see the transformed blocks and not the original code.
357357
#[cfg(feature = "minidump")]
358358
{
359-
use std::{
360-
fs::File,
361-
os::windows::io::AsRawHandle,
362-
ptr::null_mut,
363-
};
359+
use std::{fs::File, os::windows::io::AsRawHandle, ptr::null_mut};
364360

365361
use winapi::{
366362
shared::minwindef::{BOOL, DWORD, FALSE},
367363
um::{
368-
winnt::HANDLE,
369364
processthreadsapi::{
370365
GetCurrentProcess, GetCurrentProcessId, GetCurrentThreadId,
371366
},
372-
}
367+
winnt::HANDLE,
368+
},
373369
};
374370

375371
const MINI_DUMP_FULL_MEMORY_INFO: i32 = 0x00000800;

libafl_libfuzzer/libafl_libfuzzer_runtime/src/merge.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ pub fn merge(
236236
.scheduler_mut()
237237
.on_remove(&mut state, idx, &Some(testcase))?;
238238
} else {
239-
#[allow(clippy::needless_borrows_for_generic_args)] // False-positive: file_path is used just below
239+
#[allow(clippy::needless_borrows_for_generic_args)]
240+
// False-positive: file_path is used just below
240241
rename(&file_path, &new_file_path)?;
241242
*file_path = new_file_path;
242243
}

0 commit comments

Comments
 (0)