webrtcsink: turn NavigationEventHandler into a tuple wrapper

More elegant way of not bumping into the unused fields warning
than prefixing with _
This commit is contained in:
Mathieu Duponchelle 2022-03-25 02:44:42 +01:00
parent 983fcf2fbd
commit b80cf1fb8e

View file

@ -214,10 +214,7 @@ struct PipelineWrapper(gst::Pipeline);
// Structure to generate GstNavigation event from a WebRTCDataChannel
#[derive(Debug)]
struct NavigationEventHandler {
_channel: WebRTCDataChannel,
_message_sig: glib::SignalHandlerId,
}
struct NavigationEventHandler((glib::SignalHandlerId, WebRTCDataChannel));
/// Our instance structure
#[derive(Default)]
@ -1244,8 +1241,8 @@ impl NavigationEventHandler {
);
let weak_element = element.downgrade();
Self {
_message_sig: channel.connect("on-message-string", false, move |values| {
Self((
channel.connect("on-message-string", false, move |values| {
if let Some(element) = weak_element.upgrade() {
let _channel = values[0].get::<WebRTCDataChannel>().unwrap();
let msg = values[1].get::<&str>().unwrap();
@ -1254,8 +1251,8 @@ impl NavigationEventHandler {
None
}),
_channel: channel,
}
channel,
))
}
}