Use 'to_string' to format Hyper headers.

This commit is contained in:
Sergio Benitez 2017-01-31 17:32:35 -08:00
parent 5fabb43a1b
commit 35bbb8b60b
2 changed files with 2 additions and 4 deletions

View File

@ -19,7 +19,7 @@ categories = ["web-programming::http-server"]
term-painter = "^0.2"
log = "^0.3"
url = "^1"
hyper = { version = "0.10", default-features = false }
hyper = { version = "0.10.4", default-features = false }
toml = { version = "^0.2", default-features = false }
num_cpus = "1"
state = "^0.2"

View File

@ -27,7 +27,6 @@ pub use hyper::mime;
pub mod header {
use http::Header;
use hyper::header::HeaderFormatter;
use hyper::header::Header as HyperHeaderTrait;
macro_rules! import_hyper_items {
@ -38,8 +37,7 @@ pub mod header {
($($name:ident),*) => ($(
impl ::std::convert::From<self::$name> for Header<'static> {
fn from(header: self::$name) -> Header<'static> {
let formatter = HeaderFormatter(&header);
Header::new($name::header_name(), format!("{}", formatter))
Header::new($name::header_name(), header.to_string())
}
}
)*)