Skip to content

Commit

Permalink
Account for changes to cargo afl --version
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jul 12, 2024
1 parent 45e184b commit 7c6b74b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cargo-test-fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,16 @@ fn cargo_afl_version() -> Result<Version> {
.output()
.with_context(|| format!("Could not get output of `{command:?}`"))?;
let stdout = String::from_utf8_lossy(&output.stdout);
let version = stdout.strip_prefix("cargo-afl ").ok_or_else(|| {
anyhow!(
"Could not determine `cargo-afl` version. Is it installed? Try `cargo install \
cargo-afl`."
)
})?;
Version::parse(version.trim_end()).map_err(Into::into)
let version = stdout
.strip_prefix("cargo-afl ")
.and_then(|s| s.split_ascii_whitespace().next())
.ok_or_else(|| {
anyhow!(
"Could not determine `cargo-afl` version. Is it installed? Try `cargo install \
cargo-afl`."
)
})?;
Version::parse(version).map_err(Into::into)
}

fn check_dependency_version(
Expand Down

0 comments on commit 7c6b74b

Please sign in to comment.