remove unintended export of private try_ macro
This commit is contained in:
20
src/error.rs
20
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);
|
||||
|
||||
23
src/lib.rs
23
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;
|
||||
|
||||
Reference in New Issue
Block a user