mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 03:21:00 +00:00
Fix a few new clippy 1.75 warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1415>
This commit is contained in:
parent
79b8610fbe
commit
1ef47cb48e
6 changed files with 7 additions and 7 deletions
|
@ -1474,7 +1474,7 @@ fn write_dops(v: &mut Vec<u8>, caps: &gst::Caps) -> Result<(), Error> {
|
|||
.unwrap()
|
||||
.get::<gst::ArrayRef>("streamheader")
|
||||
.ok()
|
||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
{
|
||||
(
|
||||
rate,
|
||||
|
|
|
@ -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::<gst::ArrayRef>("streamheader")
|
||||
.ok()
|
||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
{
|
||||
if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() {
|
||||
gst::error!(CAT, obj: pad, "Received invalid Opus header");
|
||||
|
|
|
@ -1291,7 +1291,7 @@ fn write_dops(v: &mut Vec<u8>, caps: &gst::Caps) -> Result<(), Error> {
|
|||
.unwrap()
|
||||
.get::<gst::ArrayRef>("streamheader")
|
||||
.ok()
|
||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
{
|
||||
(
|
||||
rate,
|
||||
|
|
|
@ -902,7 +902,7 @@ impl MP4Mux {
|
|||
if let Some(header) = s
|
||||
.get::<gst::ArrayRef>("streamheader")
|
||||
.ok()
|
||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||
{
|
||||
if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() {
|
||||
gst::error!(CAT, obj: pad, "Received invalid Opus header");
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue