New version of clippy has a lot of new lints

Lots of new clippy lints due to toolchain upgrade.

Made the Message::error field pub(crate) again, it was the odd one out
and it seemed a reasonable way to shut up clippy.
This commit is contained in:
Floris Bruynooghe
2021-01-18 22:57:41 +01:00
parent 2435803fa3
commit 83dd1c6232
10 changed files with 98 additions and 86 deletions

View File

@@ -438,8 +438,10 @@ impl MimeMessage {
// Besides, we want to show something in case our incoming-processing
// failed to properly handle an incoming message.
if self.parts.is_empty() && self.mdn_reports.is_empty() {
let mut part = Part::default();
part.typ = Viewtype::Text;
let mut part = Part {
typ: Viewtype::Text,
..Default::default()
};
if let Some(ref subject) = self.get_subject() {
if !self.has_chat_version() {
@@ -617,12 +619,13 @@ impl MimeMessage {
let msg_body = context.stock_str(StockMessage::CantDecryptMsgBody).await;
let txt = format!("[{}]", msg_body);
let mut part = Part::default();
part.typ = Viewtype::Text;
part.msg_raw = Some(txt.clone());
part.msg = txt;
part.error = Some("Decryption failed".to_string());
let part = Part {
typ: Viewtype::Text,
msg_raw: Some(txt.clone()),
msg: txt,
error: Some("Decryption failed".to_string()),
..Default::default()
};
self.parts.push(part);
any_part_added = true;
@@ -654,8 +657,10 @@ impl MimeMessage {
// downloading the message again and
// delete if automatic message deletion is
// enabled.
let mut part = Part::default();
part.typ = Viewtype::Unknown;
let part = Part {
typ: Viewtype::Unknown,
..Default::default()
};
self.parts.push(part);
any_part_added = true;
@@ -783,11 +788,13 @@ impl MimeMessage {
};
if !simplified_txt.is_empty() || simplified_quote.is_some() {
let mut part = Part::default();
part.dehtml_failed = dehtml_failed;
part.typ = Viewtype::Text;
part.mimetype = Some(mime_type);
part.msg = simplified_txt;
let mut part = Part {
dehtml_failed,
typ: Viewtype::Text,
mimetype: Some(mime_type),
msg: simplified_txt,
..Default::default()
};
if let Some(quote) = simplified_quote {
part.param.set(Param::Quote, quote);
}