macro_rules! try_block {
{ $($token:tt)* } => { ... };
}
Macro to make your error-handling blocks (appear) lambda-less
let result: Result<T, E> = || {
let a = do_one(x)?;
let b = do_two(a)?;
Ok(b)
}();
let result: Result<T, E> = try_block! {
let a = do_one(x)?;
let b = do_two(a)?;
Ok(b)
};