From 1ef47cb48e9eab22031298b288ce451506be3a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 22 Dec 2023 16:40:18 +0200 Subject: [PATCH] Fix a few new clippy 1.75 warnings Part-of: --- mux/fmp4/src/fmp4mux/boxes.rs | 2 +- mux/fmp4/src/fmp4mux/imp.rs | 4 ++-- mux/mp4/src/mp4mux/boxes.rs | 2 +- mux/mp4/src/mp4mux/imp.rs | 2 +- utils/uriplaylistbin/src/uriplaylistbin/imp.rs | 2 +- video/videofx/src/videocompare/mod.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mux/fmp4/src/fmp4mux/boxes.rs b/mux/fmp4/src/fmp4mux/boxes.rs index 9d84158e..55c8c520 100644 --- a/mux/fmp4/src/fmp4mux/boxes.rs +++ b/mux/fmp4/src/fmp4mux/boxes.rs @@ -1474,7 +1474,7 @@ fn write_dops(v: &mut Vec, caps: &gst::Caps) -> Result<(), Error> { .unwrap() .get::("streamheader") .ok() - .and_then(|a| a.get(0).and_then(|v| v.get::().ok())) + .and_then(|a| a.first().and_then(|v| v.get::().ok())) { ( rate, diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index 98b8843d..fc941468 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -2408,7 +2408,7 @@ impl FMP4Mux { if let Some(super::FragmentHeaderStream { start_time: Some(start_time), .. - }) = streams.get(0) + }) = streams.first() { state.fragment_offsets.push(super::FragmentOffset { time: *start_time, @@ -2587,7 +2587,7 @@ impl FMP4Mux { if let Some(header) = s .get::("streamheader") .ok() - .and_then(|a| a.get(0).and_then(|v| v.get::().ok())) + .and_then(|a| a.first().and_then(|v| v.get::().ok())) { if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() { gst::error!(CAT, obj: pad, "Received invalid Opus header"); diff --git a/mux/mp4/src/mp4mux/boxes.rs b/mux/mp4/src/mp4mux/boxes.rs index c1fa7791..4e2188b0 100644 --- a/mux/mp4/src/mp4mux/boxes.rs +++ b/mux/mp4/src/mp4mux/boxes.rs @@ -1291,7 +1291,7 @@ fn write_dops(v: &mut Vec, caps: &gst::Caps) -> Result<(), Error> { .unwrap() .get::("streamheader") .ok() - .and_then(|a| a.get(0).and_then(|v| v.get::().ok())) + .and_then(|a| a.first().and_then(|v| v.get::().ok())) { ( rate, diff --git a/mux/mp4/src/mp4mux/imp.rs b/mux/mp4/src/mp4mux/imp.rs index eb35b643..6ea81c19 100644 --- a/mux/mp4/src/mp4mux/imp.rs +++ b/mux/mp4/src/mp4mux/imp.rs @@ -902,7 +902,7 @@ impl MP4Mux { if let Some(header) = s .get::("streamheader") .ok() - .and_then(|a| a.get(0).and_then(|v| v.get::().ok())) + .and_then(|a| a.first().and_then(|v| v.get::().ok())) { if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() { gst::error!(CAT, obj: pad, "Received invalid Opus header"); diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index 3aefa25c..38e9a93f 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -1647,7 +1647,7 @@ impl UriPlaylistBin { if let Some(state) = state_guard.as_mut() { // first streaming item is the one actually being played - if let Some(current) = state.streaming.get(0) { + if let Some(current) = state.streaming.first() { let (mut current_iteration, current_uri_index) = ( (current.index() / uris_len) as u32, (current.index() % uris_len) as u64, diff --git a/video/videofx/src/videocompare/mod.rs b/video/videofx/src/videocompare/mod.rs index bfbbef37..a1c0800a 100644 --- a/video/videofx/src/videocompare/mod.rs +++ b/video/videofx/src/videocompare/mod.rs @@ -252,7 +252,7 @@ mod test { let message: VideoCompareMessage = structure.try_into().unwrap(); assert_eq!(message.running_time, Some(running_time)); - let pad_distance = message.pad_distances.get(0).unwrap(); + let pad_distance = message.pad_distances.first().unwrap(); assert_eq!(pad_distance.pad.name().as_str(), "sink_0"); assert_eq!(pad_distance.distance, 42f64); }