From 875ab41c7d228dc61502e9b425bef5fe5f1636b4 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 10 Dec 2022 15:29:58 +0100 Subject: [PATCH] cargo: apply cargo fmt --all --- src/dump.rs | 4 +++- src/mail.rs | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/dump.rs b/src/dump.rs index a640533..61228ce 100644 --- a/src/dump.rs +++ b/src/dump.rs @@ -888,7 +888,9 @@ impl PacketDumper { i, t.convert(), if let Some(creation) = sig.signature_creation_time() { - (creation + std::time::Duration::from(*t)).convert().to_string() + (creation + std::time::Duration::from(*t)) + .convert() + .to_string() } else { " (no Signature Creation Time subpacket)".into() } diff --git a/src/mail.rs b/src/mail.rs index d622e57..d6045d0 100644 --- a/src/mail.rs +++ b/src/mail.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; use crate::counters; use handlebars::Handlebars; -use lettre::message::{Mailbox, MultiPart, SinglePart, header}; +use lettre::message::{header, Mailbox, MultiPart, SinglePart}; use lettre::{FileTransport, SendmailTransport, Transport as LettreTransport}; use serde::Serialize; use uuid::Uuid; @@ -79,7 +79,9 @@ impl Service { .host_str() .ok_or_else(|| anyhow!("No host in base-URI"))? .to_string(); - let from = from.parse().map_err(|_| anyhow!("From must be valid email address"))?; + let from = from + .parse() + .map_err(|_| anyhow!("From must be valid email address"))?; Ok(Self { from, domain, @@ -233,12 +235,14 @@ impl Service { SinglePart::builder() .header(header::ContentTransferEncoding::EightBit) .header(header::ContentType::TEXT_PLAIN) - .body(txt) + .body(txt), ) - .singlepart(SinglePart::builder() + .singlepart( + SinglePart::builder() .header(header::ContentTransferEncoding::EightBit) .header(header::ContentType::TEXT_HTML) - .body(html)), + .body(html), + ), )?; match self.transport { @@ -448,9 +452,9 @@ mod test { assert!(mail_content.contains("testtoken")); assert!(mail_content.contains("test/about")); assert!(mail_content.contains("この鍵の掲示されたア")); - assert!(mail_content.contains( - "Subject: =?utf-8?b?bG9jYWxob3N044Gu6Y2144KS566h55CG44GZ44KL?=" - )); + assert!( + mail_content.contains("Subject: =?utf-8?b?bG9jYWxob3N044Gu6Y2144KS566h55CG44GZ44KL?=") + ); } #[test]