Skip to content

Commit 57359a6

Browse files
committed
remove unintended export of private try_ macro
1 parent eae8d32 commit 57359a6

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

src/error.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -185,26 +185,6 @@ pub fn too_many_redirects(url: Url) -> Error {
185185
}
186186
}
187187

188-
#[macro_export]
189-
macro_rules! try_ {
190-
($e:expr) => (
191-
match $e {
192-
Ok(v) => v,
193-
Err(err) => {
194-
return Err(::Error::from(::error::InternalFrom(err, None)));
195-
}
196-
}
197-
);
198-
($e:expr, $url:expr) => (
199-
match $e {
200-
Ok(v) => v,
201-
Err(err) => {
202-
return Err(::Error::from(::error::InternalFrom(err, Some($url.clone()))));
203-
}
204-
}
205-
)
206-
}
207-
208188
#[test]
209189
fn test_error_get_ref_downcasts() {
210190
let err: Error = from(::hyper::Error::Status);

src/lib.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,27 @@ extern crate serde_json;
108108
extern crate serde_urlencoded;
109109
extern crate url;
110110

111+
// should be in error.rs module, but due to scopes of macros,
112+
// other modules won't see it there.
113+
macro_rules! try_ {
114+
($e:expr) => (
115+
match $e {
116+
Ok(v) => v,
117+
Err(err) => {
118+
return Err(::Error::from(::error::InternalFrom(err, None)));
119+
}
120+
}
121+
);
122+
($e:expr, $url:expr) => (
123+
match $e {
124+
Ok(v) => v,
125+
Err(err) => {
126+
return Err(::Error::from(::error::InternalFrom(err, Some($url.clone()))));
127+
}
128+
}
129+
)
130+
}
131+
111132
pub use hyper::client::IntoUrl;
112133
pub use hyper::Error as HyperError;
113134
pub use hyper::header;
@@ -124,7 +145,7 @@ pub use self::body::Body;
124145
pub use self::redirect::RedirectPolicy;
125146
pub use self::response::Response;
126147

127-
#[macro_use] mod error;
148+
mod error;
128149
mod body;
129150
mod client;
130151
mod redirect;

0 commit comments

Comments
 (0)