Inline format arguments

This feature has been stable since Rust 1.58.0.
This commit is contained in:
link2xt
2023-01-30 08:37:17 +00:00
parent c911f1262a
commit fcf73165ed
58 changed files with 357 additions and 435 deletions

View File

@@ -716,7 +716,7 @@ impl<'a> MimeFactory<'a> {
}
let message = message.replace_header(Header::new(
"Content-Type".to_string(),
format!("{} protected-headers=\"v1\";", existing_ct),
format!("{existing_ct} protected-headers=\"v1\";"),
));
// Set the appropriate Content-Type for the outer message
@@ -1234,7 +1234,7 @@ impl<'a> MimeFactory<'a> {
Some(path) => match build_selfavatar_file(context, &path).await {
Ok(avatar) => headers.hidden.push(Header::new(
"Chat-User-Avatar".into(),
format!("base64:{}", avatar),
format!("base64:{avatar}"),
)),
Err(err) => warn!(context, "mimefactory: cannot attach selfavatar: {}", err),
},
@@ -1470,7 +1470,7 @@ fn render_rfc724_mid(rfc724_mid: &str) -> String {
if rfc724_mid.chars().next().unwrap_or_default() == '<' {
rfc724_mid
} else {
format!("<{}>", rfc724_mid)
format!("<{rfc724_mid}>")
}
}
@@ -1535,7 +1535,7 @@ mod tests {
Address::new_mailbox_with_name(display_name.to_string(), addr.to_string())
);
println!("{}", s);
println!("{s}");
assert_eq!(s, "=?utf-8?q?=C3=A4_space?= <x@y.org>");
}