mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 19:41:00 +00:00
Require fallback value in Element::catch_panic() to be given as closure
This commit is contained in:
parent
ac09ae7d73
commit
cea5d4d03e
1 changed files with 2 additions and 2 deletions
|
@ -103,9 +103,9 @@ pub unsafe trait ElementBase: IsA<gst::Element> + ObjectType {
|
|||
}
|
||||
}
|
||||
|
||||
fn catch_panic<F: FnOnce(&Self) -> T, T>(&self, fallback: T, f: F) -> T {
|
||||
fn catch_panic<T, F: FnOnce(&Self) -> T, G: FnOnce() -> T>(&self, fallback: G, f: F) -> T {
|
||||
let panicked = unsafe { &(*self.get_instance()).panicked };
|
||||
panic_to_error!(self, panicked, fallback, { f(self) })
|
||||
panic_to_error!(self, panicked, fallback(), { f(self) })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue