Skip to content

Fix clippy errors on Nigthly #409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mp4parse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4328,7 +4328,7 @@ fn read_edts<T: Read>(f: &mut BMFFBox<T>, track: &mut Track) -> Result<()> {
#[allow(clippy::type_complexity)] // Allow the complex return, maybe rework in future
fn parse_mdhd<T: Read>(
f: &mut BMFFBox<T>,
track: &mut Track,
track: &Track,
) -> Result<(
MediaHeaderBox,
Option<TrackScaledTime<u64>>,
Expand Down Expand Up @@ -5020,7 +5020,7 @@ fn read_ds_descriptor(data: &[u8], esds: &mut ES_Descriptor) -> Result<()> {
}

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

if flags != 0 {
Expand Down
4 changes: 2 additions & 2 deletions mp4parse/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ fn read_mdhd_invalid_timescale() {
let mut stream = iter.next_box().unwrap().unwrap();
assert_eq!(stream.head.name, BoxType::MediaHeaderBox);
assert_eq!(stream.head.size, 44);
let r = super::parse_mdhd(&mut stream, &mut super::Track::new(0));
let r = super::parse_mdhd(&mut stream, &super::Track::new(0));
assert!(r.is_err());
}

Expand Down Expand Up @@ -944,7 +944,7 @@ fn skip_padding_in_stsd() {

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

#[test]
Expand Down
2 changes: 1 addition & 1 deletion mp4parse/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub fn create_sample_table(
};

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

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

Expand Down