From b7d4d9984f38732b697678ca64e1a66129f4f0f6 Mon Sep 17 00:00:00 2001 From: Mira Ressel Date: Wed, 14 Jun 2023 13:02:22 +0200 Subject: [PATCH] fix(build): fix hfuzz_build_args parsing The code searches hfuzz_build_args for any tokens matching "--profile", but it currently does this in a way that fails if any of the contained tokens are shorter than 9 characters. Simplify the check. --- src/bin/cargo-hfuzz.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/cargo-hfuzz.rs b/src/bin/cargo-hfuzz.rs index 75cd8c2..fa03be5 100644 --- a/src/bin/cargo-hfuzz.rs +++ b/src/bin/cargo-hfuzz.rs @@ -333,7 +333,7 @@ where else if *build_type != BuildType::Debug { // ensure we do not set --release when one of the build args // contains a --profile - if !hfuzz_build_args.any(|f| &f[..9] == "--profile") { + if !hfuzz_build_args.any(|f| f.starts_with("--profile")) { command.arg("--release"); }