diff options
author | Thomas Hurst <tom@hur.st> | 2018-09-04 22:31:57 +0100 |
---|---|---|
committer | Kartikaya Gupta (kats) <staktrace@users.noreply.github.com> | 2018-09-05 04:05:28 -0400 |
commit | 8e67af9de8d92b811809066d22a1a1caf327c78d (patch) | |
tree | eb66cd5a792ade1d9472a9bf10758ede9fb20916 | |
parent | 9ee581f8d9d0dd174c54d9c63093c8ed8e68f999 (diff) |
Use foo[] instead of .get().unwrap()
clippy:get_unwrap
-rw-r--r-- | src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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(); |