mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
Enable clippy::explicit_into_iter_loop
This commit is contained in:
@@ -418,7 +418,7 @@ impl ChatId {
|
|||||||
ProtectionStatus::Protected => match chat.typ {
|
ProtectionStatus::Protected => match chat.typ {
|
||||||
Chattype::Single | Chattype::Group | Chattype::Broadcast => {
|
Chattype::Single | Chattype::Group | Chattype::Broadcast => {
|
||||||
let contact_ids = get_chat_contacts(context, self).await?;
|
let contact_ids = get_chat_contacts(context, self).await?;
|
||||||
for contact_id in contact_ids.into_iter() {
|
for contact_id in contact_ids {
|
||||||
let contact = Contact::get_by_id(context, contact_id).await?;
|
let contact = Contact::get_by_id(context, contact_id).await?;
|
||||||
if contact.is_verified(context).await? != VerifiedStatus::BidirectVerified {
|
if contact.is_verified(context).await? != VerifiedStatus::BidirectVerified {
|
||||||
bail!("{} is not verified.", contact.get_display_name());
|
bail!("{} is not verified.", contact.get_display_name());
|
||||||
|
|||||||
@@ -727,7 +727,7 @@ impl Contact {
|
|||||||
pub async fn add_address_book(context: &Context, addr_book: &str) -> Result<usize> {
|
pub async fn add_address_book(context: &Context, addr_book: &str) -> Result<usize> {
|
||||||
let mut modify_cnt = 0;
|
let mut modify_cnt = 0;
|
||||||
|
|
||||||
for (name, addr) in split_address_book(addr_book).into_iter() {
|
for (name, addr) in split_address_book(addr_book) {
|
||||||
let (name, addr) = sanitize_name_and_addr(name, addr);
|
let (name, addr) = sanitize_name_and_addr(name, addr);
|
||||||
let name = normalize_name(&name);
|
let name = normalize_name(&name);
|
||||||
match ContactAddress::new(&addr) {
|
match ContactAddress::new(&addr) {
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ async fn export_backup_inner(
|
|||||||
let mut written_files = 0;
|
let mut written_files = 0;
|
||||||
|
|
||||||
let mut last_progress = 0;
|
let mut last_progress = 0;
|
||||||
for entry in read_dir.into_iter() {
|
for entry in read_dir {
|
||||||
let name = entry.file_name();
|
let name = entry.file_name();
|
||||||
if !entry.file_type().await?.is_file() {
|
if !entry.file_type().await?.is_file() {
|
||||||
warn!(
|
warn!(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
clippy::cast_lossless,
|
clippy::cast_lossless,
|
||||||
clippy::unused_async,
|
clippy::unused_async,
|
||||||
clippy::explicit_iter_loop,
|
clippy::explicit_iter_loop,
|
||||||
|
clippy::explicit_into_iter_loop,
|
||||||
clippy::cloned_instead_of_copied
|
clippy::cloned_instead_of_copied
|
||||||
)]
|
)]
|
||||||
#![allow(
|
#![allow(
|
||||||
|
|||||||
@@ -1502,7 +1502,7 @@ pub async fn markseen_msgs(context: &Context, msg_ids: Vec<MsgId>) -> Result<()>
|
|||||||
curr_rfc724_mid,
|
curr_rfc724_mid,
|
||||||
curr_blocked,
|
curr_blocked,
|
||||||
_curr_ephemeral_timer,
|
_curr_ephemeral_timer,
|
||||||
) in msgs.into_iter()
|
) in msgs
|
||||||
{
|
{
|
||||||
if curr_blocked == Blocked::Not
|
if curr_blocked == Blocked::Not
|
||||||
&& (curr_state == MessageState::InFresh || curr_state == MessageState::InNoticed)
|
&& (curr_state == MessageState::InFresh || curr_state == MessageState::InNoticed)
|
||||||
@@ -1741,7 +1741,7 @@ pub(crate) async fn handle_ndn(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut first = true;
|
let mut first = true;
|
||||||
for msg in msgs.into_iter() {
|
for msg in msgs {
|
||||||
let (msg_id, chat_id, chat_type) = msg?;
|
let (msg_id, chat_id, chat_type) = msg?;
|
||||||
set_msg_failed(context, msg_id, &error).await;
|
set_msg_failed(context, msg_id, &error).await;
|
||||||
if first {
|
if first {
|
||||||
|
|||||||
@@ -2162,7 +2162,7 @@ async fn check_verified_properties(
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
for (to_addr, mut is_verified) in rows.into_iter() {
|
for (to_addr, mut is_verified) in rows {
|
||||||
info!(
|
info!(
|
||||||
context,
|
context,
|
||||||
"check_verified_properties: {:?} self={:?}",
|
"check_verified_properties: {:?} self={:?}",
|
||||||
|
|||||||
Reference in New Issue
Block a user