Skip to content

Commit eb4a65b

Browse files
padenotkinetiknz
authored andcommitted
Fix clippy errors on Nightly
1 parent 12142fd commit eb4a65b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

mp4parse/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4328,7 +4328,7 @@ fn read_edts<T: Read>(f: &mut BMFFBox<T>, track: &mut Track) -> Result<()> {
43284328
#[allow(clippy::type_complexity)] // Allow the complex return, maybe rework in future
43294329
fn parse_mdhd<T: Read>(
43304330
f: &mut BMFFBox<T>,
4331-
track: &mut Track,
4331+
track: &Track,
43324332
) -> Result<(
43334333
MediaHeaderBox,
43344334
Option<TrackScaledTime<u64>>,
@@ -5020,7 +5020,7 @@ fn read_ds_descriptor(data: &[u8], esds: &mut ES_Descriptor) -> Result<()> {
50205020
}
50215021

50225022
// We are in an Audio esda Box.
5023-
let frequency_table = vec![
5023+
let frequency_table = [
50245024
(0x0, 96000),
50255025
(0x1, 88200),
50265026
(0x2, 64000),
@@ -5767,7 +5767,7 @@ fn read_audio_sample_entry<T: Read>(src: &mut BMFFBox<T>) -> Result<SampleEntry>
57675767
/// Parse a stsd box.
57685768
/// See ISOBMFF (ISO 14496-12:2020) § 8.5.2
57695769
/// See MP4 (ISO 14496-14:2020) § 6.7.2
5770-
fn read_stsd<T: Read>(src: &mut BMFFBox<T>, track: &mut Track) -> Result<SampleDescriptionBox> {
5770+
fn read_stsd<T: Read>(src: &mut BMFFBox<T>, track: &Track) -> Result<SampleDescriptionBox> {
57715771
let (_, flags) = read_fullbox_extra(src)?;
57725772

57735773
if flags != 0 {

mp4parse/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fn read_mdhd_invalid_timescale() {
360360
let mut stream = iter.next_box().unwrap().unwrap();
361361
assert_eq!(stream.head.name, BoxType::MediaHeaderBox);
362362
assert_eq!(stream.head.size, 44);
363-
let r = super::parse_mdhd(&mut stream, &mut super::Track::new(0));
363+
let r = super::parse_mdhd(&mut stream, &super::Track::new(0));
364364
assert!(r.is_err());
365365
}
366366

@@ -944,7 +944,7 @@ fn skip_padding_in_stsd() {
944944

945945
let mut iter = super::BoxIter::new(&mut stream);
946946
let mut stream = iter.next_box().unwrap().unwrap();
947-
super::read_stsd(&mut stream, &mut super::Track::new(0)).expect("fail to skip padding: stsd");
947+
super::read_stsd(&mut stream, &super::Track::new(0)).expect("fail to skip padding: stsd");
948948
}
949949

950950
#[test]

mp4parse/src/unstable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub fn create_sample_table(
146146
};
147147

148148
// According to spec, no sync table means every sample is sync sample.
149-
let has_sync_table = matches!(track.stss, Some(_));
149+
let has_sync_table = track.stss.is_some();
150150

151151
let mut sample_size_iter = stsz.sample_sizes.iter();
152152

0 commit comments

Comments
 (0)