Created
July 28, 2015 18:34
-
-
Save muja/96ecec36a7af14650ded 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
impl<F> NetworkConnector for F where F: Fn(&str, u16, &str) -> io::Result<TcpStream> { | |
type Stream = HttpStream; | |
fn connect(&self, host: &str, port: u16, scheme: &str) -> ::Result<HttpStream> { | |
Ok(HttpStream(try!((*self)(host, port, scheme)))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment