Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
aawsome committed Jan 13, 2025
1 parent 25f908b commit 13587a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/core/src/commands/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ impl RestorePlan {

let matches = open_file
.as_mut()
.map_or(false, |file| id.blob_matches_reader(usize_length, file));
.is_some_and(|file| id.blob_matches_reader(usize_length, file));

let blob_location = self.r.entry((ie.pack, bl)).or_default();
blob_location.push(FileLocation {
Expand Down
4 changes: 1 addition & 3 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,7 @@ impl RusticError {

/// Checks if the error has a specific error code.
pub fn is_code(&self, code: &str) -> bool {
self.error_code
.as_ref()
.map_or(false, |c| c.as_str() == code)
self.error_code.as_ref().is_some_and(|c| c.as_str() == code)
}

/// Checks if the error is due to an incorrect password
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/index/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@ impl<BE: DecryptWriteBackend> Indexer<BE> {
pub fn has(&self, id: &BlobId) -> bool {
self.indexed
.as_ref()
.map_or(false, |indexed| indexed.contains(id))
.is_some_and(|indexed| indexed.contains(id))
}
}

0 comments on commit 13587a2

Please sign in to comment.