Skip to content

Commit

Permalink
Add clippy exclusion for build-script set item, fix clippy issue with…
Browse files Browse the repository at this point in the history
… eager iterator cloning
  • Loading branch information
novafacing committed Aug 31, 2023
1 parent 3c77c70 commit 7f27b9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libafl_libfuzzer/libafl_libfuzzer_runtime/src/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ pub fn merge(
let loaded_dirs = options
.dirs()
.iter()
.filter(|dir| state.corpus().dir_path() != *dir)
.cloned()
.filter(|dir| state.corpus().dir_path() != dir)
.collect::<Vec<_>>();
// Load from disk
state
Expand Down
10 changes: 8 additions & 2 deletions libafl_libfuzzer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ use std::ffi::{c_char, c_int};

pub use libfuzzer_sys::*;

#[cfg(all(feature = "embed-runtime", target_family = "unix"))]
#[cfg(all(
feature = "embed-runtime",
target_family = "unix",
// Disable when building with clippy, as it will complain about the missing environment
// variable which is set by the build script, which is not run under clippy.
not(feature = "cargo-clippy")
))]
pub const LIBAFL_LIBFUZZER_RUNTIME_LIBRARY: &'static [u8] =
include_bytes!(env!("LIBAFL_LIBFUZZER_RUNTIME_PATH"));

Expand All @@ -97,7 +103,7 @@ extern "C" {

#[cfg(test)]
mod tests {
#[cfg(feature = "embed-runtime")]
#[cfg(all(feature = "embed-runtime", not(feature = "cargo-clippy")))]
#[test]
fn test_embed_runtime_sized() {
use crate::LIBAFL_LIBFUZZER_RUNTIME_LIBRARY;
Expand Down

0 comments on commit 7f27b9a

Please sign in to comment.