1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-10-03 16:51:58 +00:00

content_disposition: remove unnecessary allocations

This commit is contained in:
axon-q 2018-06-12 13:48:23 +00:00
parent 4d69e6d0b4
commit e414a52b51

View file

@ -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),
}));