orinfar 0.0.1

A Text Editor For Witches
1
2
3
4
5
6
7
8
9
10
use anyhow::Result;
use std::panic::{self};

pub fn add_panic_hook<F: Fn() -> Result<()> + Send + Sync>(cleanup: &'static F) {
    panic::update_hook(|old_hook, info| {
        cleanup().expect("Cleanup failed");

        old_hook(info);
    });
}