From 0b066b7529f6541dcc72c636952e2848aaa307b3 Mon Sep 17 00:00:00 2001 From: Perma Alesheikh Date: Tue, 9 Jan 2024 14:29:52 +0330 Subject: [PATCH] remove unnessary conversions to itself Reasons: - Remove unnecessary steps. into() is called on String when the expected type is already String. Signed-off-by: Perma Alesheikh --- src/email/message/command/read.rs | 5 ++--- src/email/message/template/command/forward.rs | 5 ++--- src/email/message/template/command/reply.rs | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/email/message/command/read.rs b/src/email/message/command/read.rs index 91f1e6c..8b6555d 100644 --- a/src/email/message/command/read.rs +++ b/src/email/message/command/read.rs @@ -152,7 +152,7 @@ impl MessageReadCommand { // display what can be displayed bodies.push_str(&String::from_utf8_lossy(email.raw()?)); } else { - let tpl: String = email + let tpl = email .to_read_tpl(&account_config, |mut tpl| { if self.no_headers { tpl = tpl.with_hide_all_headers(); @@ -166,8 +166,7 @@ impl MessageReadCommand { tpl }) - .await? - .into(); + .await?; bodies.push_str(&tpl); } diff --git a/src/email/message/template/command/forward.rs b/src/email/message/template/command/forward.rs index db23211..76ab2e0 100644 --- a/src/email/message/template/command/forward.rs +++ b/src/email/message/template/command/forward.rs @@ -95,7 +95,7 @@ impl TemplateForwardCommand { .await?; let id = self.envelope.id; - let tpl: String = backend + let tpl = backend .get_messages(folder, &[id]) .await? .first() @@ -104,8 +104,7 @@ impl TemplateForwardCommand { .with_headers(self.headers.raw) .with_body(self.body.raw()) .build() - .await? - .into(); + .await?; printer.print(tpl) } diff --git a/src/email/message/template/command/reply.rs b/src/email/message/template/command/reply.rs index 583cae1..1add3bc 100644 --- a/src/email/message/template/command/reply.rs +++ b/src/email/message/template/command/reply.rs @@ -99,7 +99,7 @@ impl TemplateReplyCommand { ) .await?; - let tpl: String = backend + let tpl = backend .get_messages(folder, &[id]) .await? .first() @@ -109,8 +109,7 @@ impl TemplateReplyCommand { .with_body(self.body.raw()) .with_reply_all(self.reply.all) .build() - .await? - .into(); + .await?; printer.print(tpl) }