Skip to content

Commit a68ddab

Browse files
committed
chore: apply beta clippy fixes
1 parent 877f873 commit a68ddab

File tree

8 files changed

+12
-13
lines changed

8 files changed

+12
-13
lines changed

src/blob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<'a> BlobObject<'a> {
9393
if let Some(extension) = original_name.extension().filter(|e| e.len() <= 32) {
9494
let extension = extension.to_string_lossy().to_lowercase();
9595
let extension = sanitize_filename(&extension);
96-
format!("$BLOBDIR/{hash}.{}", extension)
96+
format!("$BLOBDIR/{hash}.{extension}")
9797
} else {
9898
format!("$BLOBDIR/{hash}")
9999
};

src/chat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ impl ChatId {
653653
) -> Result<()> {
654654
let chat_id = ChatId::create_for_contact_with_blocked(context, contact_id, Blocked::Yes)
655655
.await
656-
.with_context(|| format!("can't create chat for {}", contact_id))?;
656+
.with_context(|| format!("can't create chat for {contact_id}"))?;
657657
chat_id
658658
.set_protection(
659659
context,

src/chatlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl Chatlist {
322322
(chat_id, MessageState::OutDraft),
323323
)
324324
.await
325-
.with_context(|| format!("failed to get msg ID for chat {}", chat_id))?;
325+
.with_context(|| format!("failed to get msg ID for chat {chat_id}"))?;
326326
ids.push((chat_id, msg_id));
327327
}
328328
Ok(Chatlist { ids })

src/context.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,21 +1061,21 @@ impl Context {
10611061
)
10621062
.await?
10631063
.unwrap_or_default();
1064-
res += &format!("num_msgs {}\n", num_msgs);
1064+
res += &format!("num_msgs {num_msgs}\n");
10651065

10661066
let num_chats: u32 = self
10671067
.sql
10681068
.query_get_value("SELECT COUNT(*) FROM chats WHERE id>9 AND blocked!=1", ())
10691069
.await?
10701070
.unwrap_or_default();
1071-
res += &format!("num_chats {}\n", num_chats);
1071+
res += &format!("num_chats {num_chats}\n");
10721072

10731073
let db_size = tokio::fs::metadata(&self.sql.dbfile).await?.len();
1074-
res += &format!("db_size_bytes {}\n", db_size);
1074+
res += &format!("db_size_bytes {db_size}\n");
10751075

10761076
let secret_key = &load_self_secret_key(self).await?.primary_key;
10771077
let key_created = secret_key.created_at().timestamp();
1078-
res += &format!("key_created {}\n", key_created);
1078+
res += &format!("key_created {key_created}\n");
10791079

10801080
// how many of the chats active in the last months are:
10811081
// - protected
@@ -1155,7 +1155,7 @@ impl Context {
11551155
id
11561156
}
11571157
};
1158-
res += &format!("self_reporting_id {}", self_reporting_id);
1158+
res += &format!("self_reporting_id {self_reporting_id}");
11591159

11601160
Ok(res)
11611161
}

src/imap/imap_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ fn test_build_sequence_sets() {
5656
}
5757

5858
let has_number = |(uids, s): &(Vec<u32>, String), number| {
59-
uids.iter().any(|&n| n == number)
60-
&& s.split(',').any(|n| n.parse::<u32>().unwrap() == number)
59+
uids.contains(&number) && s.split(',').any(|n| n.parse::<u32>().unwrap() == number)
6160
};
6261

6362
let numbers: Vec<_> = (2..=500).step_by(2).collect();

src/mimeparser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2380,7 +2380,7 @@ async fn handle_ndn(
23802380
let aggregated_error = message
23812381
.error
23822382
.as_ref()
2383-
.map(|err| format!("{}\n\n{}", err, err_msg));
2383+
.map(|err| format!("{err}\n\n{err_msg}"));
23842384
set_msg_failed(
23852385
context,
23862386
&mut message,

src/receive_imf/receive_imf_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ async fn test_concat_multiple_ndns() -> Result<()> {
904904
let raw = include_str!("../../test-data/message/posteo_ndn.eml");
905905
let raw = raw.replace(
906906
"Message-ID: <04422840-f884-3e37-5778-8192fe22d8e1@posteo.de>",
907-
&format!("Message-ID: <{}>", mid),
907+
&format!("Message-ID: <{mid}>"),
908908
);
909909
receive_imf(&t, raw.as_bytes(), false).await?;
910910

src/webxdc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ impl Message {
965965
let fingerprint = load_self_public_key(context).await?.dc_fingerprint().hex();
966966
let data = format!("{}-{}", fingerprint, self.rfc724_mid);
967967
let hash = Sha256::digest(data.as_bytes());
968-
Ok(format!("{:x}", hash))
968+
Ok(format!("{hash:x}"))
969969
}
970970

971971
/// Get link attached to an info message.

0 commit comments

Comments
 (0)