From 57359a6e2f2216f5e8403390779a9a119b84ecc4 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 18 May 2017 09:19:12 -0700 Subject: [PATCH] remove unintended export of private try_ macro --- src/error.rs | 20 -------------------- src/lib.rs | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/error.rs b/src/error.rs index bda4c02c8..9eba05827 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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); diff --git a/src/lib.rs b/src/lib.rs index 7ecbe99de..f8a7696ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;