Skip to content

Commit

Permalink
fix clippy lints (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
aawsome authored Oct 29, 2023
1 parent 47fc1f4 commit 7bfcd43
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/blob/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,7 @@ pub(crate) fn merge_trees(
}
impl PartialOrd for SortedNode {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0
.name
.partial_cmp(&other.0.name)
.map(std::cmp::Ordering::reverse)
Some(self.cmp(other))
}
}
impl Eq for SortedNode {}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ impl RestorePlan {
.as_mut()
.map_or(false, |file| id.blob_matches_reader(length as usize, file));

let blob_location = self.r.entry((ie.pack, bl)).or_insert_with(Vec::new);
let blob_location = self.r.entry((ie.pack, bl)).or_default();
blob_location.push(FileLocation {
file_idx,
file_start: file_pos,
Expand Down
2 changes: 1 addition & 1 deletion src/repofile/indexfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl PartialOrd<Self> for IndexBlob {
///
/// The ordering of the two blobs
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.offset.partial_cmp(&other.offset)
Some(self.cmp(other))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/repofile/snapshotfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ impl Eq for SnapshotFile {}

impl PartialOrd for SnapshotFile {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.time.partial_cmp(&other.time)
Some(self.cmp(other))
}
}
impl Ord for SnapshotFile {
Expand Down

0 comments on commit 7bfcd43

Please sign in to comment.