From 634dfaa1caba0a101ede3b8859f405e6db7fc594 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Wed, 28 Aug 2019 00:03:07 +0000 Subject: [PATCH] Fix one clippy::unneeded_unwrap warning --- src/job.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/job.rs b/src/job.rs index 949912b1a..2bdcfb7ef 100644 --- a/src/job.rs +++ b/src/job.rs @@ -136,12 +136,8 @@ impl Job { if unsafe { strlen(filename) } == 0 { warn!(context, 0, "Missing file name for job {}", self.job_id,); } else if 0 != unsafe { dc_read_file(context, filename, &mut buf, &mut buf_bytes) } { - let recipients = self.param.get(Param::Recipients); - if recipients.is_none() { - warn!(context, 0, "Missing recipients for job {}", self.job_id,); - } else { + if let Some(recipients) = self.param.get(Param::Recipients) { let recipients_list = recipients - .unwrap() .split("\x1e") .filter_map(|addr| match lettre::EmailAddress::new(addr.to_string()) { Ok(addr) => Some(addr), @@ -210,6 +206,8 @@ impl Job { } } } + } else { + warn!(context, 0, "Missing recipients for job {}", self.job_id,); } } }