about summary refs log tree commit diff stats
path: root/crates/libmpv2/src/mpv/protocol.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-21 22:32:54 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-21 22:32:54 +0100
commitb1474f9dc8dc1ed22c2a78680e40bd315cb82b0f (patch)
treedd07f07483f13d0479075bfd15346a70c5041698 /crates/libmpv2/src/mpv/protocol.rs
parentfix(yt/storage/notify): Switch from a polling based system to inotify (diff)
downloadyt-b1474f9dc8dc1ed22c2a78680e40bd315cb82b0f.zip
chore(crates/libmpv2): Make `cargo clippy` happy
Diffstat (limited to '')
-rw-r--r--crates/libmpv2/src/mpv/protocol.rs6
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(