diff options
| author | Mica White <botahamec@gmail.com> | 2024-12-26 11:26:39 -0500 |
|---|---|---|
| committer | Mica White <botahamec@gmail.com> | 2024-12-26 12:06:47 -0500 |
| commit | dc16634f4abdb1e830d2749e64b419740702b302 (patch) | |
| tree | eb51ba8293a1c719c7221d546185cfa7062c108c /src/handle_unwind.rs | |
| parent | 096afea6f13692fddbfad0b07e5377cb2e81dd58 (diff) | |
Commenting
Diffstat (limited to 'src/handle_unwind.rs')
| -rw-r--r-- | src/handle_unwind.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/handle_unwind.rs b/src/handle_unwind.rs index d515449..220d379 100644 --- a/src/handle_unwind.rs +++ b/src/handle_unwind.rs @@ -1,5 +1,6 @@ use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe}; +/// Runs `try_fn`. If it unwinds, it will run `catch` and then continue unwinding pub fn handle_unwind<R, F: FnOnce() -> R, G: FnOnce()>(try_fn: F, catch: G) -> R { let try_fn = AssertUnwindSafe(try_fn); catch_unwind(try_fn).unwrap_or_else(|e| { |
