remove unintended export of private try_ macro

This commit is contained in:
Sean McArthur
2017-05-18 09:19:12 -07:00
parent eae8d32b7c
commit 57359a6e2f
2 changed files with 22 additions and 21 deletions

View File

@@ -185,26 +185,6 @@ pub fn too_many_redirects(url: Url) -> Error {
}
}
#[macro_export]
macro_rules! try_ {
($e:expr) => (
match $e {
Ok(v) => v,
Err(err) => {
return Err(::Error::from(::error::InternalFrom(err, None)));
}
}
);
($e:expr, $url:expr) => (
match $e {
Ok(v) => v,
Err(err) => {
return Err(::Error::from(::error::InternalFrom(err, Some($url.clone()))));
}
}
)
}
#[test]
fn test_error_get_ref_downcasts() {
let err: Error = from(::hyper::Error::Status);

View File

@@ -108,6 +108,27 @@ extern crate serde_json;
extern crate serde_urlencoded;
extern crate url;
// should be in error.rs module, but due to scopes of macros,
// other modules won't see it there.
macro_rules! try_ {
($e:expr) => (
match $e {
Ok(v) => v,
Err(err) => {
return Err(::Error::from(::error::InternalFrom(err, None)));
}
}
);
($e:expr, $url:expr) => (
match $e {
Ok(v) => v,
Err(err) => {
return Err(::Error::from(::error::InternalFrom(err, Some($url.clone()))));
}
}
)
}
pub use hyper::client::IntoUrl;
pub use hyper::Error as HyperError;
pub use hyper::header;
@@ -124,7 +145,7 @@ pub use self::body::Body;
pub use self::redirect::RedirectPolicy;
pub use self::response::Response;
#[macro_use] mod error;
mod error;
mod body;
mod client;
mod redirect;