-
-
Save steveatinfincia/ec682b6443633d9287cdd3afec058922 to your computer and use it in GitHub Desktop.
This file contains 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
// error: | |
error[E0277]: the trait bound `mymodule::MyHeader: mymodule::reqwest::header::Header` is not satisfied | |
// in crate root | |
#[macro_use] extern crate hyper; | |
// original code in mymodule using header! macro from Hyper | |
extern crate reqwest; | |
extern crate serde; | |
extern crate serde_json; | |
extern crate hyper; | |
header! { (MyHeader, "My-Header") => [String] } | |
// expands to (among other things): | |
pub struct MyHeader(pub String); | |
impl ::header::Header for MyHeader { | |
fn header_name() -> &'static str { | |
"My-Header" | |
} | |
fn parse_header(raw: &[Vec<u8>]) -> ::Result<Self> { | |
::header::parsing::from_one_raw_str(raw).map(MyHeader) | |
} | |
} | |
impl ::header::HeaderFormat for MyHeader { | |
fn fmt_header(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { | |
::std::fmt::Display::fmt(&**self, f) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment