From b06a692dea3d7d8fcb6fa26a36f2254aad3b8607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 10 Aug 2022 12:27:00 +0300 Subject: [PATCH] Fix a new beta clippy warning warning: unused return value of `std::boxed::Box::::from_raw` that must be used --> gstreamer-rtsp-server/src/rtsp_session_pool.rs:23:5 | 23 | Box::::from_raw(ptr as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_must_use)]` on by default = note: call `drop(from_raw(ptr))` if you intend to drop the `Box` --- gstreamer-app/src/app_sink.rs | 2 +- gstreamer-app/src/app_src.rs | 2 +- gstreamer-rtsp-server/src/rtsp_session_pool.rs | 2 +- gstreamer/src/bus.rs | 6 +++--- gstreamer/src/clock.rs | 4 ++-- gstreamer/src/pad.rs | 4 ++-- gstreamer/src/typefind.rs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gstreamer-app/src/app_sink.rs b/gstreamer-app/src/app_sink.rs index ad5a79a49..39a43837e 100644 --- a/gstreamer-app/src/app_sink.rs +++ b/gstreamer-app/src/app_sink.rs @@ -264,7 +264,7 @@ unsafe extern "C" fn trampoline_new_event( } unsafe extern "C" fn destroy_callbacks(ptr: gpointer) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } impl AppSink { diff --git a/gstreamer-app/src/app_src.rs b/gstreamer-app/src/app_src.rs index d71618691..e6dfbae0c 100644 --- a/gstreamer-app/src/app_src.rs +++ b/gstreamer-app/src/app_src.rs @@ -201,7 +201,7 @@ unsafe extern "C" fn trampoline_seek_data( } unsafe extern "C" fn destroy_callbacks(ptr: gpointer) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } impl AppSrc { diff --git a/gstreamer-rtsp-server/src/rtsp_session_pool.rs b/gstreamer-rtsp-server/src/rtsp_session_pool.rs index 579a9dc62..9a0c1b42b 100644 --- a/gstreamer-rtsp-server/src/rtsp_session_pool.rs +++ b/gstreamer-rtsp-server/src/rtsp_session_pool.rs @@ -20,7 +20,7 @@ unsafe extern "C" fn destroy_closure_watch< >( ptr: gpointer, ) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } fn into_raw_watch Continue + Send + 'static>(func: F) -> gpointer { diff --git a/gstreamer/src/bus.rs b/gstreamer/src/bus.rs index 8fa46f48e..21bba98ad 100644 --- a/gstreamer/src/bus.rs +++ b/gstreamer/src/bus.rs @@ -31,7 +31,7 @@ unsafe extern "C" fn destroy_closure_watch< >( ptr: gpointer, ) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } fn into_raw_watch Continue + Send + 'static>(func: F) -> gpointer { @@ -53,7 +53,7 @@ unsafe extern "C" fn trampoline_watch_local Continue unsafe extern "C" fn destroy_closure_watch_local Continue + 'static>( ptr: gpointer, ) { - Box::>::from_raw(ptr as *mut _); + let _ = Box::>::from_raw(ptr as *mut _); } fn into_raw_watch_local Continue + 'static>(func: F) -> gpointer { @@ -85,7 +85,7 @@ unsafe extern "C" fn destroy_closure_sync< >( ptr: gpointer, ) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } fn into_raw_sync BusSyncReply + Send + Sync + 'static>( diff --git a/gstreamer/src/clock.rs b/gstreamer/src/clock.rs index cf63eb1d8..ecd0fa66f 100644 --- a/gstreamer/src/clock.rs +++ b/gstreamer/src/clock.rs @@ -169,7 +169,7 @@ impl SingleShotClockId { >( ptr: gpointer, ) { - Box::>::from_raw(ptr as *mut _); + let _ = Box::>::from_raw(ptr as *mut _); } let func: Box> = Box::new(Some(func)); @@ -286,7 +286,7 @@ impl PeriodicClockId { >( ptr: gpointer, ) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } let func: Box = Box::new(func); diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 98a2937da..1223a59dd 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -1592,7 +1592,7 @@ unsafe extern "C" fn trampoline_unlink_function< } unsafe extern "C" fn destroy_closure(ptr: gpointer) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } unsafe extern "C" fn trampoline_pad_task(func: gpointer) { @@ -1607,7 +1607,7 @@ fn into_raw_pad_task(func: F) -> gpointer { } unsafe extern "C" fn destroy_closure_pad_task(ptr: gpointer) { - Box::::from_raw(ptr as *mut _); + let _ = Box::::from_raw(ptr as *mut _); } impl Pad { diff --git a/gstreamer/src/typefind.rs b/gstreamer/src/typefind.rs index 55c88c705..5b074b5bd 100644 --- a/gstreamer/src/typefind.rs +++ b/gstreamer/src/typefind.rs @@ -125,7 +125,7 @@ unsafe extern "C" fn type_find_trampoline( data: glib::ffi::gpointer, ) { - Box::::from_raw(data as *mut _); + let _ = Box::::from_raw(data as *mut _); } unsafe extern "C" fn type_find_peek(