diff --git a/Cargo.toml b/Cargo.toml index d251cd8..621b422 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,3 +45,6 @@ cli = [ "cargo_metadata", ] coverage = ["fork", "libc"] + +[lints.clippy] +needless_doctest_main = "allow" diff --git a/examples/url/Cargo.toml b/examples/url/Cargo.toml index 51eb1f6..b19ce17 100644 --- a/examples/url/Cargo.toml +++ b/examples/url/Cargo.toml @@ -7,3 +7,6 @@ publish = false [dependencies] url = "2.5.0" ziggy = { path = "../../", default-features = false } + +[features] +fuzzing = [] \ No newline at end of file diff --git a/examples/url/src/main.rs b/examples/url/src/main.rs index b468195..ef3586f 100644 --- a/examples/url/src/main.rs +++ b/examples/url/src/main.rs @@ -11,7 +11,7 @@ // could assert that a certain value satisfies a property. fn invariant_fuzz(data: &str) { if let Ok(parsed) = url::Url::parse(data) { - #[cfg(not(fuzzing))] + #[cfg(not(feature = "fuzzing"))] println!("{data} => {parsed}"); // We assert that the string representation of the URL always contains a ':' // character. diff --git a/src/bin/cargo-ziggy/fuzz.rs b/src/bin/cargo-ziggy/fuzz.rs index d7112a8..acf1298 100644 --- a/src/bin/cargo-ziggy/fuzz.rs +++ b/src/bin/cargo-ziggy/fuzz.rs @@ -800,7 +800,7 @@ impl fmt::Display for FuzzingConfig { pub fn kill_subprocesses_recursively(pid: &str) -> Result<(), Error> { let subprocesses = process::Command::new("pgrep") - .arg(&format!("-P{pid}")) + .arg(format!("-P{pid}")) .output()?; for subprocess in std::str::from_utf8(&subprocesses.stdout)?.split('\n') { diff --git a/tests/arbitrary_fuzz.rs b/tests/arbitrary_fuzz.rs index 5c81286..9dc8152 100644 --- a/tests/arbitrary_fuzz.rs +++ b/tests/arbitrary_fuzz.rs @@ -7,7 +7,7 @@ use std::{ fn kill_subprocesses_recursively(pid: &str) { let subprocesses = process::Command::new("pgrep") - .arg(&format!("-P{pid}")) + .arg(format!("-P{pid}")) .output() .unwrap(); diff --git a/tests/url_fuzz.rs b/tests/url_fuzz.rs index 2ff51b8..8609ecd 100644 --- a/tests/url_fuzz.rs +++ b/tests/url_fuzz.rs @@ -7,7 +7,7 @@ use std::{ fn kill_subprocesses_recursively(pid: &str) { let subprocesses = process::Command::new("pgrep") - .arg(&format!("-P{pid}")) + .arg(format!("-P{pid}")) .output() .unwrap();