Skip to content

Commit 8ff62e3

Browse files
committed
Fix cargo clippy warnings and errors
1 parent c72fc62 commit 8ff62e3

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/project.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ impl FuzzProject {
353353
// Use the user-provided target directory, if provided. Otherwise if building for coverage,
354354
// use the coverage directory
355355
if let Some(target_dir) = build.target_dir.as_ref() {
356-
return Ok(Some(PathBuf::from(target_dir)));
356+
Ok(Some(PathBuf::from(target_dir)))
357357
} else if build.coverage {
358358
// To ensure that fuzzing and coverage-output generation can run in parallel, we
359359
// produce a separate binary for the coverage command.
@@ -387,7 +387,7 @@ impl FuzzProject {
387387
cmd.arg("--bins");
388388
}
389389

390-
if let Some(target_dir) = self.target_dir(&build)? {
390+
if let Some(target_dir) = self.target_dir(build)? {
391391
cmd.arg("--target-dir").arg(target_dir);
392392
}
393393

@@ -756,7 +756,7 @@ impl FuzzProject {
756756
for corpus in corpora.iter() {
757757
// _tmp_dir is deleted when it goes of of scope.
758758
let (mut cmd, _tmp_dir) =
759-
self.create_coverage_cmd(coverage, &coverage_out_raw_dir, &corpus.as_path())?;
759+
self.create_coverage_cmd(coverage, &coverage_out_raw_dir, corpus.as_path())?;
760760
eprintln!("Generating coverage data for corpus {:?}", corpus);
761761
let status = cmd
762762
.status()

src/rustc_version.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn rust_version_string() -> anyhow::Result<String> {
2222
String::from_utf8(raw_output).context("`rustc --version` returned non-text output somehow")
2323
}
2424

25-
#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd)]
25+
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
2626
pub struct RustVersion {
2727
pub major: u32,
2828
pub minor: u32,
@@ -39,6 +39,12 @@ impl Ord for RustVersion {
3939
}
4040
}
4141

42+
impl PartialOrd for RustVersion {
43+
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
44+
Some(self.cmp(other))
45+
}
46+
}
47+
4248
impl RustVersion {
4349
pub fn discover() -> anyhow::Result<Self> {
4450
let version_string = rust_version_string()?;

0 commit comments

Comments
 (0)