refactor: enable clippy::manual_is_variant_and

This commit is contained in:
link2xt
2026-02-05 20:38:46 +00:00
committed by l
parent 983f43c33c
commit cc38298163
3 changed files with 5 additions and 6 deletions

View File

@@ -591,8 +591,7 @@ impl Context {
.get_config(key) .get_config(key)
.await? .await?
.and_then(|s| s.parse::<i32>().ok()) .and_then(|s| s.parse::<i32>().ok())
.map(|x| x != 0) .is_some_and(|x| x != 0))
.unwrap_or_default())
} }
/// Returns true if movebox ("DeltaChat" folder) should be watched. /// Returns true if movebox ("DeltaChat" folder) should be watched.

View File

@@ -2152,11 +2152,10 @@ pub(crate) async fn prefetch_should_download(
let accepted_contact = origin.is_known(); let accepted_contact = origin.is_known();
let is_reply_to_chat_message = get_prefetch_parent_message(context, headers) let is_reply_to_chat_message = get_prefetch_parent_message(context, headers)
.await? .await?
.map(|parent| match parent.is_dc_message { .is_some_and(|parent| match parent.is_dc_message {
MessengerMessage::No => false, MessengerMessage::No => false,
MessengerMessage::Yes | MessengerMessage::Reply => true, MessengerMessage::Yes | MessengerMessage::Reply => true,
}) });
.unwrap_or_default();
let show_emails = let show_emails =
ShowEmails::from_i32(context.get_config_int(Config::ShowEmails).await?).unwrap_or_default(); ShowEmails::from_i32(context.get_config_int(Config::ShowEmails).await?).unwrap_or_default();

View File

@@ -14,7 +14,8 @@
clippy::unused_async, clippy::unused_async,
clippy::explicit_iter_loop, clippy::explicit_iter_loop,
clippy::explicit_into_iter_loop, clippy::explicit_into_iter_loop,
clippy::cloned_instead_of_copied clippy::cloned_instead_of_copied,
clippy::manual_is_variant_and
)] )]
#![cfg_attr(not(test), forbid(clippy::indexing_slicing))] #![cfg_attr(not(test), forbid(clippy::indexing_slicing))]
#![cfg_attr(not(test), forbid(clippy::string_slice))] #![cfg_attr(not(test), forbid(clippy::string_slice))]