refactor(headers): Use macros for headers where possible

This commit is contained in:
Pyfisch
2015-02-16 19:26:40 +01:00
parent f554c09e12
commit de1be67262
11 changed files with 70 additions and 202 deletions

View File

@@ -88,7 +88,7 @@ macro_rules! impl_list_header(
($from:ident, $name:expr, $item:ty) => {
deref!($from => $item);
impl header::Header for $from {
impl $crate::header::Header for $from {
fn header_name() -> &'static str {
$name
}
@@ -98,7 +98,7 @@ macro_rules! impl_list_header(
}
}
impl header::HeaderFormat for $from {
impl $crate::header::HeaderFormat for $from {
fn fmt_header(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
$crate::header::parsing::fmt_comma_delimited(fmt, &self[])
}
@@ -118,7 +118,7 @@ macro_rules! impl_header(
($from:ident, $name:expr, $item:ty) => {
deref!($from => $item);
impl header::Header for $from {
impl $crate::header::Header for $from {
fn header_name() -> &'static str {
$name
}
@@ -128,7 +128,7 @@ macro_rules! impl_header(
}
}
impl header::HeaderFormat for $from {
impl $crate::header::HeaderFormat for $from {
fn fmt_header(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::std::fmt::Display::fmt(&**self, f)
}