fix(header): fix fmt_header outputs of several headers

Closes #246
This commit is contained in:
Sean McArthur
2015-01-13 10:42:01 -08:00
parent cfebdabc1a
commit aa26665367
11 changed files with 45 additions and 62 deletions

View File

@@ -1,5 +1,5 @@
use header::{Header, HeaderFormat};
use std::fmt::{self, Show};
use std::fmt;
use std::str::FromStr;
use header::shared::util::{from_comma_delimited, fmt_comma_delimited};
@@ -12,7 +12,7 @@ pub struct Upgrade(pub Vec<Protocol>);
deref!(Upgrade => Vec<Protocol>);
/// Protocol values that can appear in the Upgrade header.
#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Show)]
pub enum Protocol {
/// The websocket protocol.
WebSocket,
@@ -38,12 +38,6 @@ impl fmt::String for Protocol {
}
}
impl fmt::Show for Protocol {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
self.to_string().fmt(fmt)
}
}
impl Header for Upgrade {
fn header_name(_: Option<Upgrade>) -> &'static str {
"Upgrade"