diff --git a/src/blob.rs b/src/blob.rs index 9b53fbcf5..1589b1d3e 100644 --- a/src/blob.rs +++ b/src/blob.rs @@ -93,7 +93,7 @@ impl<'a> BlobObject<'a> { if let Some(extension) = original_name.extension().filter(|e| e.len() <= 32) { let extension = extension.to_string_lossy().to_lowercase(); let extension = sanitize_filename(&extension); - format!("$BLOBDIR/{hash}.{}", extension) + format!("$BLOBDIR/{hash}.{extension}") } else { format!("$BLOBDIR/{hash}") }; diff --git a/src/chat.rs b/src/chat.rs index e23e1607f..e07b7761f 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -653,7 +653,7 @@ impl ChatId { ) -> Result<()> { let chat_id = ChatId::create_for_contact_with_blocked(context, contact_id, Blocked::Yes) .await - .with_context(|| format!("can't create chat for {}", contact_id))?; + .with_context(|| format!("can't create chat for {contact_id}"))?; chat_id .set_protection( context, diff --git a/src/chatlist.rs b/src/chatlist.rs index eb1f278b2..d8f704340 100644 --- a/src/chatlist.rs +++ b/src/chatlist.rs @@ -322,7 +322,7 @@ impl Chatlist { (chat_id, MessageState::OutDraft), ) .await - .with_context(|| format!("failed to get msg ID for chat {}", chat_id))?; + .with_context(|| format!("failed to get msg ID for chat {chat_id}"))?; ids.push((chat_id, msg_id)); } Ok(Chatlist { ids }) diff --git a/src/context.rs b/src/context.rs index 35d7c0a42..5af9b2ee0 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1061,21 +1061,21 @@ impl Context { ) .await? .unwrap_or_default(); - res += &format!("num_msgs {}\n", num_msgs); + res += &format!("num_msgs {num_msgs}\n"); let num_chats: u32 = self .sql .query_get_value("SELECT COUNT(*) FROM chats WHERE id>9 AND blocked!=1", ()) .await? .unwrap_or_default(); - res += &format!("num_chats {}\n", num_chats); + res += &format!("num_chats {num_chats}\n"); let db_size = tokio::fs::metadata(&self.sql.dbfile).await?.len(); - res += &format!("db_size_bytes {}\n", db_size); + res += &format!("db_size_bytes {db_size}\n"); let secret_key = &load_self_secret_key(self).await?.primary_key; let key_created = secret_key.created_at().timestamp(); - res += &format!("key_created {}\n", key_created); + res += &format!("key_created {key_created}\n"); // how many of the chats active in the last months are: // - protected @@ -1155,7 +1155,7 @@ impl Context { id } }; - res += &format!("self_reporting_id {}", self_reporting_id); + res += &format!("self_reporting_id {self_reporting_id}"); Ok(res) } diff --git a/src/imap/imap_tests.rs b/src/imap/imap_tests.rs index 1b81ffc09..c2f5678b5 100644 --- a/src/imap/imap_tests.rs +++ b/src/imap/imap_tests.rs @@ -56,8 +56,7 @@ fn test_build_sequence_sets() { } let has_number = |(uids, s): &(Vec, String), number| { - uids.iter().any(|&n| n == number) - && s.split(',').any(|n| n.parse::().unwrap() == number) + uids.contains(&number) && s.split(',').any(|n| n.parse::().unwrap() == number) }; let numbers: Vec<_> = (2..=500).step_by(2).collect(); diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 980ba2414..f6c9c1327 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -2380,7 +2380,7 @@ async fn handle_ndn( let aggregated_error = message .error .as_ref() - .map(|err| format!("{}\n\n{}", err, err_msg)); + .map(|err| format!("{err}\n\n{err_msg}")); set_msg_failed( context, &mut message, diff --git a/src/receive_imf/receive_imf_tests.rs b/src/receive_imf/receive_imf_tests.rs index c9093eb85..5b1ce99e6 100644 --- a/src/receive_imf/receive_imf_tests.rs +++ b/src/receive_imf/receive_imf_tests.rs @@ -904,7 +904,7 @@ async fn test_concat_multiple_ndns() -> Result<()> { let raw = include_str!("../../test-data/message/posteo_ndn.eml"); let raw = raw.replace( "Message-ID: <04422840-f884-3e37-5778-8192fe22d8e1@posteo.de>", - &format!("Message-ID: <{}>", mid), + &format!("Message-ID: <{mid}>"), ); receive_imf(&t, raw.as_bytes(), false).await?; diff --git a/src/webxdc.rs b/src/webxdc.rs index 50f6ccba0..ecc4d58f9 100644 --- a/src/webxdc.rs +++ b/src/webxdc.rs @@ -965,7 +965,7 @@ impl Message { let fingerprint = load_self_public_key(context).await?.dc_fingerprint().hex(); let data = format!("{}-{}", fingerprint, self.rfc724_mid); let hash = Sha256::digest(data.as_bytes()); - Ok(format!("{:x}", hash)) + Ok(format!("{hash:x}")) } /// Get link attached to an info message.