#7 Merge gihub patch - fix

2-bindgen
Pierre Réveillon 2021-12-06 00:18:23 +01:00
parent 31db9558af
commit 5cff23e543
1 changed files with 2 additions and 9 deletions

View File

@ -325,15 +325,8 @@ pub struct EventManager<'a> {
impl<'a> EventManager<'a> { impl<'a> EventManager<'a> {
pub fn detach(&self, event_type: EventType, registered_callback: *mut c_void) -> Result<(),()> { pub fn detach(&self, event_type: EventType, registered_callback: *mut c_void) {
let result = unsafe { unsafe { sys::libvlc_event_detach(self.ptr, event_type as i32, Some(event_manager_callback), registered_callback) }
sys::libvlc_event_detach(self.ptr, event_type as i32, event_manager_callback, registered_callback)
};
if result == 0 {
Ok(())
} else {
Err(())
}
} }
pub fn attach<F>(&self, event_type: EventType, callback: F) -> Result<*mut c_void, ()> pub fn attach<F>(&self, event_type: EventType, callback: F) -> Result<*mut c_void, ()>