diff --git a/src/tools.rs b/src/tools.rs index bb6cc5e2..fa970798 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -27,6 +27,11 @@ pub mod ticket; pub mod borrow; pub mod fs; +#[macro_export] +macro_rules! try_block { + { $($token:tt)* } => {{ (|| -> Result<_,_> { $($token)* })() }} +} + /// The `BufferedReader` trait provides a single function /// `buffered_read`. It returns a reference to an internal buffer. The /// purpose of this traid is to avoid unnecessary data copies.