From 8e67af9de8d92b811809066d22a1a1caf327c78d Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Tue, 4 Sep 2018 22:31:57 +0100 Subject: Use foo[] instead of .get().unwrap() clippy:get_unwrap --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { 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(); -- cgit v1.2.3