From d05f02b5aab3920d3b858e8ff5ae5dd0127f5c52 Mon Sep 17 00:00:00 2001 From: Peter Grayson Date: Sun, 27 Aug 2023 10:24:17 -0400 Subject: [PATCH] refactor: repair clippy lint --- src/cmd/import.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cmd/import.rs b/src/cmd/import.rs index ea87ffda..5440931b 100644 --- a/src/cmd/import.rs +++ b/src/cmd/import.rs @@ -823,16 +823,15 @@ impl Headers { let header = parts.next().expect("mailinfo header line has header"); let value = parts.next().expect("mailinfo header line has value"); if let Ok(value) = value.to_str() { - let value = Some(value.to_string()); + let value = value.to_string(); match header { - b"Author" => author_name = value, - b"Email" => author_email = value, - b"Date" => author_date = value, - b"Subject" => subject = value, + b"Author" => author_name = Some(value), + b"Email" => author_email = Some(value), + b"Date" => author_date = Some(value), + b"Subject" => subject = Some(value), _ => panic!( - "unexpected mailinfo header \"{}\" with value \"{}\"", - header.to_str_lossy(), - value.unwrap() + "unexpected mailinfo header \"{}\" with value \"{value}\"", + header.to_str_lossy() ), } }