From d2985c5b2efd3b0500e9da6693873e342e16eb07 Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Mon, 2 Jan 2023 20:35:41 +0900 Subject: [PATCH] Clippy fix (#978) * fix * mac * clp --- libafl/src/bolts/core_affinity.rs | 1 - libafl/src/executors/forkserver.rs | 2 +- libafl_frida/src/drcov_rt.rs | 2 +- libafl_frida/src/pthread_hook.rs | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libafl/src/bolts/core_affinity.rs b/libafl/src/bolts/core_affinity.rs index a59e1da8c6..2432c85d14 100644 --- a/libafl/src/bolts/core_affinity.rs +++ b/libafl/src/bolts/core_affinity.rs @@ -566,7 +566,6 @@ mod apple { #[allow(clippy::unnecessary_wraps)] pub fn get_core_ids() -> Result, Error> { Ok((0..(usize::from(available_parallelism()?))) - .into_iter() .map(|n| CoreId { id: n }) .collect::>()) } diff --git a/libafl/src/executors/forkserver.rs b/libafl/src/executors/forkserver.rs index e58739c59d..1c1eb63550 100644 --- a/libafl/src/executors/forkserver.rs +++ b/libafl/src/executors/forkserver.rs @@ -1242,7 +1242,7 @@ mod tests { let executor = ForkserverExecutorBuilder::new() .program(bin) - .args(&args) + .args(args) .debug_child(false) .shmem_provider(&mut shmem_provider) .build::<_, ()>(tuple_list!(edges_observer)); diff --git a/libafl_frida/src/drcov_rt.rs b/libafl_frida/src/drcov_rt.rs index 871aec9843..70d7853f87 100644 --- a/libafl_frida/src/drcov_rt.rs +++ b/libafl_frida/src/drcov_rt.rs @@ -47,7 +47,7 @@ impl FridaRuntime for DrCovRuntime { hasher.write(input.target_bytes().as_slice()); let filename = format!("./coverage/{:016x}.drcov", hasher.finish(),); - DrCovWriter::new(&self.ranges).write(&filename, &self.drcov_basic_blocks)?; + DrCovWriter::new(&self.ranges).write(filename, &self.drcov_basic_blocks)?; self.drcov_basic_blocks.clear(); Ok(()) diff --git a/libafl_frida/src/pthread_hook.rs b/libafl_frida/src/pthread_hook.rs index b783aeb5c5..99fe3f558d 100644 --- a/libafl_frida/src/pthread_hook.rs +++ b/libafl_frida/src/pthread_hook.rs @@ -165,7 +165,7 @@ where }; // Allow because we're sure this isn't from a different code generation unit. - #[allow(clippy::fn_address_comparisons)] + #[allow(clippy::fn_address_comparisons, clippy::fn_null_check)] if !(prev as *const libc::c_void).is_null() && prev != pthread_introspection_hook { PREVIOUS_HOOK.set(prev); }