-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow header #188
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow header #188
Conversation
I couldn't figure out how to get the empty
|
Can you rebase this to get rid of the merge commit? |
mod tests { | ||
use super::Allow; | ||
use header::Header; | ||
use super::super::super::super::method::Method::{mod, Options, Get, Put, Post, Delete, Head, Trace, Connect, Patch, Extension}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should be able to just use method::Method::..
Rebased, also added a bench |
impl HeaderFormat for Allow { | ||
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result { | ||
let Allow(ref parts) = *self; | ||
fmt_comma_delimited(fmt, parts[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be just 'self[]' because of Deref.
What test was failing? |
@seanmonstar I tried to test for an empty vec.
which was giving the above-mentioned error. I couldn't figure out what was wrong with this, so I removed the test before pushing. |
Could it be that it's parsing Can't wait rust-lang/rfcs#504 |
Just checked, that was indeed the problem. Should we include this test, then? (asserting against |
We should have the test that the vec is empty. That it's parsing into an Extension sounds like a bug in |
Sorry, wrong place. The bug is here: https://github.com/hyperium/hyper/blob/master/src/method.rs#L82 |
Patched that, and also addressed the |
woo! thanks |
#174