Last active
August 29, 2015 14:01
-
-
Save db48x/77d0d464e42450cd0369 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl Header for Expires { | |
fn parse_header(raw: &[Vec<u8>]) -> Option<Expires> { | |
require_single_field!(raw); | |
match Header::parse_header(raw) { | |
Some(tm) => Some(ExpiresDate(tm)), | |
None => Some(Past), | |
} | |
} | |
fn fmt_header(&self, w: &mut Writer) -> fmt::Result { | |
match *self { | |
Past => write!(w, "0"), | |
ExpiresDate(ref tm) => write!(w, "{}", tm.to_utc().strftime("%a, %d %b %Y %T GMT")), | |
} | |
} | |
} | |
match *self { | |
Past => | |
match () { | |
() => { | |
#[address_insignificant] | |
#[allow(dead_code)] | |
static __STATIC_FMTSTR: [::std::fmt::rt::Piece<'static>, ..1u] = | |
[::std::fmt::rt::String("Past")]; | |
let __args_vec = &[]; | |
let __args = | |
unsafe { | |
::std::fmt::Arguments::new(__STATIC_FMTSTR, __args_vec) | |
}; | |
__arg_0.write_fmt(&__args) | |
} | |
}, | |
ExpiresDate(ref __self_0) => | |
match (&(*__self_0),) { | |
(__arg0,) => { | |
#[address_insignificant] | |
#[allow(dead_code)] | |
static __STATIC_FMTSTR: [::std::fmt::rt::Piece<'static>, ..3u] = | |
[::std::fmt::rt::String("ExpiresDate("), | |
::std::fmt::rt::Argument(::std::fmt::rt::Argument{position: ::std::fmt::rt::ArgumentNext, | |
format: ::std::fmt::rt::FormatSpec{fill: ' ', | |
align: ::std::fmt::rt::AlignUnknown, | |
flags: 0u, | |
precision: ::std::fmt::rt::CountImplied, | |
width: ::std::fmt::rt::CountImplied, }, | |
method: ::std::option::None, }), | |
::std::fmt::rt::String(")")]; | |
let __args_vec = &[::std::fmt::argument(::std::fmt::secret_show, __arg0)]; | |
let __args = | |
unsafe { | |
::std::fmt::Arguments::new(__STATIC_FMTSTR, __args_vec) | |
}; | |
__arg_0.write_fmt(&__args) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment