diff options
Diffstat (limited to 'crates/libmpv2/src/mpv/protocol.rs')
-rw-r--r-- | crates/libmpv2/src/mpv/protocol.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/libmpv2/src/mpv/protocol.rs b/crates/libmpv2/src/mpv/protocol.rs index c4f0e2f..ec840d8 100644 --- a/crates/libmpv2/src/mpv/protocol.rs +++ b/crates/libmpv2/src/mpv/protocol.rs @@ -101,7 +101,7 @@ where let slice = slice::from_raw_parts_mut(buf, nbytes as _); ((*data).read_fn)(&mut *(*data).cookie, slice) }); - if let Ok(ret) = ret { ret } else { -1 } + ret.unwrap_or(-1) } unsafe extern "C" fn seek_wrapper<T, U>(cookie: *mut ctype::c_void, offset: i64) -> i64 @@ -173,8 +173,8 @@ pub struct ProtocolContext<'parent, T: RefUnwindSafe, U: RefUnwindSafe> { _does_not_outlive: PhantomData<&'parent Mpv>, } -unsafe impl<'parent, T: RefUnwindSafe, U: RefUnwindSafe> Send for ProtocolContext<'parent, T, U> {} -unsafe impl<'parent, T: RefUnwindSafe, U: RefUnwindSafe> Sync for ProtocolContext<'parent, T, U> {} +unsafe impl<T: RefUnwindSafe, U: RefUnwindSafe> Send for ProtocolContext<'_, T, U> {} +unsafe impl<T: RefUnwindSafe, U: RefUnwindSafe> Sync for ProtocolContext<'_, T, U> {} impl<'parent, T: RefUnwindSafe, U: RefUnwindSafe> ProtocolContext<'parent, T, U> { fn new( |