mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-06-03 10:14:10 +02:00
fixes
This commit is contained in:
parent
8d17b30682
commit
95119b9347
13 changed files with 157 additions and 161 deletions
|
|
@ -110,15 +110,15 @@ fn micros_as_sec(micros: usize) -> f32 {
|
|||
micros as f32 / 1_000_000.0
|
||||
}
|
||||
|
||||
struct PanicCanary<F: Fn() -> ()>(F);
|
||||
struct PanicCanary<F: Fn()>(F);
|
||||
|
||||
impl<F: Fn() -> ()> Drop for PanicCanary<F> {
|
||||
impl<F: Fn()> Drop for PanicCanary<F> {
|
||||
fn drop(&mut self) {
|
||||
(self.0)()
|
||||
}
|
||||
}
|
||||
|
||||
fn on_panic<F: Fn() -> (), P: Fn() -> ()>(f: F, panic: P) {
|
||||
fn on_panic<F: Fn(), P: Fn()>(f: F, panic: P) {
|
||||
let canary = PanicCanary(panic);
|
||||
f();
|
||||
forget(canary)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue