tools.rs: new try_block macro
This commit is contained in:
		@ -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.
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user