diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2023-01-25 11:23:46 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-01-25 11:31:19 +0300 |
commit | 3b4c48d9f55ae5bfb6eb4fe485edf54f8916d955 (patch) | |
tree | 69f065a49d4035b924d0c1f7025186d597a55590 /utils/togglerecord | |
parent | ad3f1cf534b475d47d4ef4d0e8916d507c6e56e5 (diff) |
Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1062>
Diffstat (limited to 'utils/togglerecord')
-rw-r--r-- | utils/togglerecord/examples/gtk_recording.rs | 4 | ||||
-rw-r--r-- | utils/togglerecord/src/togglerecord/imp.rs | 63 |
2 files changed, 33 insertions, 34 deletions
diff --git a/utils/togglerecord/examples/gtk_recording.rs b/utils/togglerecord/examples/gtk_recording.rs index ab5d441a..ff3af6ae 100644 --- a/utils/togglerecord/examples/gtk_recording.rs +++ b/utils/togglerecord/examples/gtk_recording.rs @@ -232,14 +232,14 @@ fn create_ui(app: >k::Application) { let position = video_sink .query_position::<gst::ClockTime>() .unwrap_or(gst::ClockTime::ZERO); - position_label.set_text(&format!("Position: {:.1}", position)); + position_label.set_text(&format!("Position: {position:.1}")); let recording_duration = togglerecord .static_pad("src") .unwrap() .query_position::<gst::ClockTime>() .unwrap_or(gst::ClockTime::ZERO); - recorded_duration_label.set_text(&format!("Recorded: {:.1}", recording_duration)); + recorded_duration_label.set_text(&format!("Recorded: {recording_duration:.1}")); glib::Continue(true) }); diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs index 55052134..beffa206 100644 --- a/utils/togglerecord/src/togglerecord/imp.rs +++ b/utils/togglerecord/src/togglerecord/imp.rs @@ -2002,40 +2002,39 @@ impl ElementImpl for ToggleRecord { *pad_count += 1; let templ = self.obj().pad_template("sink_%u").unwrap(); - let sinkpad = - gst::Pad::builder_with_template(&templ, Some(format!("sink_{}", id).as_str())) - .chain_function(|pad, parent, buffer| { - ToggleRecord::catch_panic_pad_function( - parent, - || Err(gst::FlowError::Error), - |togglerecord| togglerecord.sink_chain(pad, buffer), - ) - }) - .event_function(|pad, parent, event| { - ToggleRecord::catch_panic_pad_function( - parent, - || false, - |togglerecord| togglerecord.sink_event(pad, event), - ) - }) - .query_function(|pad, parent, query| { - ToggleRecord::catch_panic_pad_function( - parent, - || false, - |togglerecord| togglerecord.sink_query(pad, query), - ) - }) - .iterate_internal_links_function(|pad, parent| { - ToggleRecord::catch_panic_pad_function( - parent, - || gst::Iterator::from_vec(vec![]), - |togglerecord| togglerecord.iterate_internal_links(pad), - ) - }) - .build(); + let sinkpad = gst::Pad::builder_with_template(&templ, Some(format!("sink_{id}").as_str())) + .chain_function(|pad, parent, buffer| { + ToggleRecord::catch_panic_pad_function( + parent, + || Err(gst::FlowError::Error), + |togglerecord| togglerecord.sink_chain(pad, buffer), + ) + }) + .event_function(|pad, parent, event| { + ToggleRecord::catch_panic_pad_function( + parent, + || false, + |togglerecord| togglerecord.sink_event(pad, event), + ) + }) + .query_function(|pad, parent, query| { + ToggleRecord::catch_panic_pad_function( + parent, + || false, + |togglerecord| togglerecord.sink_query(pad, query), + ) + }) + .iterate_internal_links_function(|pad, parent| { + ToggleRecord::catch_panic_pad_function( + parent, + || gst::Iterator::from_vec(vec![]), + |togglerecord| togglerecord.iterate_internal_links(pad), + ) + }) + .build(); let templ = self.obj().pad_template("src_%u").unwrap(); - let srcpad = gst::Pad::builder_with_template(&templ, Some(format!("src_{}", id).as_str())) + let srcpad = gst::Pad::builder_with_template(&templ, Some(format!("src_{id}").as_str())) .event_function(|pad, parent, event| { ToggleRecord::catch_panic_pad_function( parent, |