From e414a52b5102e8d364510393582af6a86f345d05 Mon Sep 17 00:00:00 2001 From: axon-q Date: Tue, 12 Jun 2018 13:48:23 +0000 Subject: [PATCH] content_disposition: remove unnecessary allocations --- src/header/common/content_disposition.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/header/common/content_disposition.rs b/src/header/common/content_disposition.rs index 0edebfedb..ff04ef565 100644 --- a/src/header/common/content_disposition.rs +++ b/src/header/common/content_disposition.rs @@ -193,8 +193,9 @@ impl fmt::Display for ContentDisposition { } } if use_simple_format { + use std::str; try!(write!(f, "; filename=\"{}\"", - match String::from_utf8(bytes.clone()) { + match str::from_utf8(bytes) { Ok(s) => s, Err(_) => return Err(fmt::Error), }));