Enable clippy::explicit_into_iter_loop

This commit is contained in:
link2xt
2023-03-12 14:51:44 +00:00
parent 2bd7781276
commit 4d620afdb8
6 changed files with 7 additions and 6 deletions

View File

@@ -418,7 +418,7 @@ impl ChatId {
ProtectionStatus::Protected => match chat.typ {
Chattype::Single | Chattype::Group | Chattype::Broadcast => {
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?;
if contact.is_verified(context).await? != VerifiedStatus::BidirectVerified {
bail!("{} is not verified.", contact.get_display_name());

View File

@@ -727,7 +727,7 @@ impl Contact {
pub async fn add_address_book(context: &Context, addr_book: &str) -> Result<usize> {
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 = normalize_name(&name);
match ContactAddress::new(&addr) {

View File

@@ -602,7 +602,7 @@ async fn export_backup_inner(
let mut written_files = 0;
let mut last_progress = 0;
for entry in read_dir.into_iter() {
for entry in read_dir {
let name = entry.file_name();
if !entry.file_type().await?.is_file() {
warn!(

View File

@@ -14,6 +14,7 @@
clippy::cast_lossless,
clippy::unused_async,
clippy::explicit_iter_loop,
clippy::explicit_into_iter_loop,
clippy::cloned_instead_of_copied
)]
#![allow(

View File

@@ -1502,7 +1502,7 @@ pub async fn markseen_msgs(context: &Context, msg_ids: Vec<MsgId>) -> Result<()>
curr_rfc724_mid,
curr_blocked,
_curr_ephemeral_timer,
) in msgs.into_iter()
) in msgs
{
if curr_blocked == Blocked::Not
&& (curr_state == MessageState::InFresh || curr_state == MessageState::InNoticed)
@@ -1741,7 +1741,7 @@ pub(crate) async fn handle_ndn(
};
let mut first = true;
for msg in msgs.into_iter() {
for msg in msgs {
let (msg_id, chat_id, chat_type) = msg?;
set_msg_failed(context, msg_id, &error).await;
if first {

View File

@@ -2162,7 +2162,7 @@ async fn check_verified_properties(
)
.await?;
for (to_addr, mut is_verified) in rows.into_iter() {
for (to_addr, mut is_verified) in rows {
info!(
context,
"check_verified_properties: {:?} self={:?}",