Skip to content

Commit

Permalink
remove unintended export of private try_ macro
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed May 18, 2017
1 parent eae8d32 commit 57359a6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
20 changes: 0 additions & 20 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
23 changes: 22 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 57359a6

Please sign in to comment.