tools.rs: new try_block macro
This commit is contained in:
parent
1d77b6cf6b
commit
f0dbba8cbe
@ -27,6 +27,11 @@ pub mod ticket;
|
|||||||
pub mod borrow;
|
pub mod borrow;
|
||||||
pub mod fs;
|
pub mod fs;
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! try_block {
|
||||||
|
{ $($token:tt)* } => {{ (|| -> Result<_,_> { $($token)* })() }}
|
||||||
|
}
|
||||||
|
|
||||||
/// The `BufferedReader` trait provides a single function
|
/// The `BufferedReader` trait provides a single function
|
||||||
/// `buffered_read`. It returns a reference to an internal buffer. The
|
/// `buffered_read`. It returns a reference to an internal buffer. The
|
||||||
/// purpose of this traid is to avoid unnecessary data copies.
|
/// purpose of this traid is to avoid unnecessary data copies.
|
||||||
|
Loading…
Reference in New Issue
Block a user