add another test, add unwind_protect!

This commit is contained in:
Mark Thom
2019-03-04 22:34:17 -07:00
parent 11026e2741
commit e4cc54104e
3 changed files with 31 additions and 4 deletions

View File

@@ -244,6 +244,15 @@ macro_rules! get_level_and_unify {
)
}
macro_rules! unwind_protect {
($e: expr, $protected: expr) => (
match $e {
Err(e) => { $protected; return Err(e); },
_ => {}
}
)
}
macro_rules! discard_result {
($f: expr) => (
match $f {