mirror of
https://github.com/actix/actix-extras.git
synced 2025-01-23 15:24:36 +01:00
content_disposition: remove unnecessary allocations
This commit is contained in:
parent
4d69e6d0b4
commit
e414a52b51
@ -193,8 +193,9 @@ impl fmt::Display for ContentDisposition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if use_simple_format {
|
if use_simple_format {
|
||||||
|
use std::str;
|
||||||
try!(write!(f, "; filename=\"{}\"",
|
try!(write!(f, "; filename=\"{}\"",
|
||||||
match String::from_utf8(bytes.clone()) {
|
match str::from_utf8(bytes) {
|
||||||
Ok(s) => s,
|
Ok(s) => s,
|
||||||
Err(_) => return Err(fmt::Error),
|
Err(_) => return Err(fmt::Error),
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user