Skip to content

Commit

Permalink
chore: Beta clippy suggestions (#6271)
Browse files Browse the repository at this point in the history
Already apply rust beta (1.84) clippy suggestions now, before they let
CI fail in 6 weeks.

The newly used functions are available since 1.70, our MSRV is 1.77, so
we can use them.
  • Loading branch information
Hocuri authored Dec 2, 2024
1 parent 06a7c63 commit 587ea02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/mimeparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ impl MimeMessage {
&& self
.parts
.get(1)
.map_or(false, |filepart| match filepart.typ {
.is_some_and(|filepart| match filepart.typ {
Viewtype::Image
| Viewtype::Gif
| Viewtype::Sticker
Expand Down
12 changes: 5 additions & 7 deletions src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,13 +887,11 @@ pub async fn remove_unused_files(context: &Context) -> Result<()> {
}
unreferenced_count += 1;
let recently_created =
stats.created().map_or(false, |t| t > keep_files_newer_than);
let recently_modified = stats
.modified()
.map_or(false, |t| t > keep_files_newer_than);
let recently_accessed = stats
.accessed()
.map_or(false, |t| t > keep_files_newer_than);
stats.created().is_ok_and(|t| t > keep_files_newer_than);
let recently_modified =
stats.modified().is_ok_and(|t| t > keep_files_newer_than);
let recently_accessed =
stats.accessed().is_ok_and(|t| t > keep_files_newer_than);

if p == blobdir
&& (recently_created || recently_modified || recently_accessed)
Expand Down

0 comments on commit 587ea02

Please sign in to comment.