about summary refs log tree commit diff stats
path: root/crates/libmpv2/src/mpv
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libmpv2/src/mpv')
-rw-r--r--crates/libmpv2/src/mpv/protocol.rs2
-rw-r--r--crates/libmpv2/src/mpv/render.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/libmpv2/src/mpv/protocol.rs b/crates/libmpv2/src/mpv/protocol.rs
index 4ae4f16..31a5933 100644
--- a/crates/libmpv2/src/mpv/protocol.rs
+++ b/crates/libmpv2/src/mpv/protocol.rs
@@ -155,7 +155,7 @@ where
 {
     let data = Box::from_raw(cookie as *mut ProtocolData<T, U>);
 
-    panic::catch_unwind(|| ((*data).close_fn)(Box::from_raw((*data).cookie)));
+    panic::catch_unwind(|| (data.close_fn)(Box::from_raw(data.cookie)));
 }
 
 struct ProtocolData<T, U> {
diff --git a/crates/libmpv2/src/mpv/render.rs b/crates/libmpv2/src/mpv/render.rs
index 91db34e..c3f2dc9 100644
--- a/crates/libmpv2/src/mpv/render.rs
+++ b/crates/libmpv2/src/mpv/render.rs
@@ -213,8 +213,8 @@ impl RenderContext {
         params: impl IntoIterator<Item = RenderParam<C>>,
     ) -> Result<Self> {
         let params: Vec<_> = params.into_iter().collect();
-        let mut raw_params: Vec<libmpv2_sys::mpv_render_param> = Vec::new();
-        raw_params.reserve(params.len() + 1);
+        let mut raw_params: Vec<libmpv2_sys::mpv_render_param> =
+            Vec::with_capacity(params.len() + 1);
         let mut raw_ptrs: HashMap<*const c_void, DeleterFn> = HashMap::new();
 
         for p in params {