diff --git a/Cargo.lock b/Cargo.lock index c3bd0f9..032a9bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -642,9 +642,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "1.0.77" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0" +checksum = "a4eac2e6c19f5c3abc0c229bea31ff0b9b091c7b14990e8924b92902a303a0c0" dependencies = [ "proc-macro2", "quote", diff --git a/src/findings.rs b/src/findings.rs index 9059a93..ca06799 100644 --- a/src/findings.rs +++ b/src/findings.rs @@ -24,9 +24,7 @@ pub struct Findings { } impl PartialOrd for Findings { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } impl Ord for Findings { @@ -37,12 +35,12 @@ impl Ord for Findings { // valid Findings to be equal, avoiding the (somewhat) expensive call to recommended_extension. after all, since // fif never displays valid files, it really doesn't matter what position they end up in. if self.valid || other.valid { - return Ordering::Equal + return Ordering::Equal; } - match(self.recommended_extension(), other.recommended_extension()) { + match (self.recommended_extension(), other.recommended_extension()) { (None, Some(_)) => Ordering::Greater, (Some(_), None) => Ordering::Less, - _ => self.file.cmp(&other.file) + _ => self.file.cmp(&other.file), } } } diff --git a/src/formats.rs b/src/formats.rs index a5d0167..b50028f 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -61,7 +61,7 @@ type Entries<'a> = [Result>]; fn sort_entries<'a>(entries: &'a Entries) -> (Vec<&'a Findings>, Vec<&'a ScanError<'a>>) { let (mut findings, mut errors): (Vec<_>, Vec<_>) = entries.iter().partition_map(|entry| match entry { Ok(f) => Either::Left(f), - Err(e) => Either::Right(e) + Err(e) => Either::Right(e), }); findings.sort_unstable(); @@ -347,7 +347,6 @@ impl Format for Json { let (findings, errors) = &sort_entries(entries); - let result = serde_json::to_writer_pretty(f, &SerdeEntries { errors, findings }); if let Err(err) = result {