Avoid double boxing of oneshot when calling `LKRoomPublishVideoTrack`

Antonio Scandurra and Nathan Sobo created

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

crates/live_kit/src/live_kit.rs | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

Detailed changes

crates/live_kit/src/live_kit.rs 🔗

@@ -61,12 +61,7 @@ impl Room {
     pub fn publish_video_track(&self, track: &LocalVideoTrack) -> impl Future<Output = Result<()>> {
         let (did_publish, tx, rx) = Self::build_done_callback();
         unsafe {
-            LKRoomPublishVideoTrack(
-                self.0,
-                track.0,
-                did_publish,
-                Box::into_raw(Box::new(tx)) as *mut c_void,
-            )
+            LKRoomPublishVideoTrack(self.0, track.0, did_publish, tx);
         }
         async { rx.await.unwrap().context("error publishing video track") }
     }