a few fixes

This commit is contained in:
Sean McArthur
2016-11-08 18:56:49 -08:00
parent 1741efc089
commit 4f9e39829c
3 changed files with 21 additions and 10 deletions

View File

@@ -91,12 +91,13 @@
extern crate hyper;
#[macro_use] extern crate log;
#[cfg(feature = "tls")] extern crate native_tls;
extern crate native_tls;
extern crate serde;
extern crate serde_json;
extern crate serde_urlencoded;
extern crate url;
pub use hyper::client::IntoUrl;
pub use hyper::header;
pub use hyper::method::Method;
pub use hyper::status::StatusCode;
@@ -111,11 +112,11 @@ pub use self::body::Body;
mod body;
mod client;
mod error;
mod tls;
#[cfg(feature = "tls")] mod tls;
/// Shortcut method to quickly make a `GET` request.
pub fn get(url: &str) -> ::Result<Response> {
pub fn get<T: IntoUrl>(url: T) -> ::Result<Response> {
let client = try!(Client::new());
client.get(url).send()
}