summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hurst <tom@hur.st>2018-09-04 22:31:57 +0100
committerKartikaya Gupta (kats) <staktrace@users.noreply.github.com>2018-09-05 04:05:28 -0400
commit8e67af9de8d92b811809066d22a1a1caf327c78d (patch)
treeeb66cd5a792ade1d9472a9bf10758ede9fb20916
parent9ee581f8d9d0dd174c54d9c63093c8ed8e68f999 (diff)
downloadmailparse-8e67af9de8d92b811809066d22a1a1caf327c78d.tar.gz
mailparse-8e67af9de8d92b811809066d22a1a1caf327c78d.tar.xz
Use foo[] instead of .get().unwrap()
clippy:get_unwrap
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b5f0a92..3b59f19 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -785,7 +785,7 @@ pub fn parse_mail(raw_data: &[u8]) -> Result<ParsedMail, MailParseError> {
if result.ctype.mimetype.starts_with("multipart/") &&
result.ctype.params.get("boundary").is_some() && raw_data.len() > ix_body
{
- let boundary = String::from("--") + result.ctype.params.get("boundary").unwrap();
+ let boundary = String::from("--") + &result.ctype.params["boundary"];
if let Some(ix_body_end) = find_from_u8(raw_data, ix_body, boundary.as_bytes()) {
result.body = &raw_data[ix_body..ix_body_end];
let mut ix_boundary_end = ix_body_end + boundary.len();