Merge pull request #321 from pyfisch/refactorheaders

refactor(headers): Use macros for headers where possible
This commit is contained in:
Sean McArthur
2015-02-17 08:46:03 -08:00
11 changed files with 70 additions and 202 deletions

View File

@@ -90,7 +90,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
}
@@ -100,7 +100,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[])
}
@@ -120,7 +120,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
}
@@ -130,7 +130,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)
}