Skip to content

Commit 02d54e6

Browse files
authored
Merge pull request #88 from rillian/clippy
Fix another clippy issue.
2 parents 585eac9 + 14de347 commit 02d54e6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

mp4parse/tests/public.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ fn public_api() {
4545
// track.data part
4646
assert_eq!(match v.codec_specific {
4747
mp4::VideoCodecSpecific::AVCConfig(v) => {
48-
assert!(v.len() > 0);
48+
assert!(!v.is_empty());
4949
"AVC"
5050
}
5151
mp4::VideoCodecSpecific::VPxConfig(vpx) => {
5252
// We don't enter in here, we just check if fields are public.
5353
assert!(vpx.bit_depth > 0);
5454
assert!(vpx.color_space > 0);
5555
assert!(vpx.chroma_subsampling > 0);
56-
assert!(vpx.codec_init.len() > 0);
56+
assert!(!vpx.codec_init.is_empty());
5757
"VPx"
5858
}
5959
}, "AVC");
@@ -82,7 +82,7 @@ fn public_api() {
8282
}
8383
mp4::AudioCodecSpecific::FLACSpecificBox(flac) => {
8484
// STREAMINFO block must be present and first.
85-
assert!(flac.blocks.len() > 0);
85+
assert!(!flac.blocks.is_empty());
8686
assert_eq!(flac.blocks[0].block_type, 0);
8787
assert_eq!(flac.blocks[0].data.len(), 34);
8888
"FLAC"
@@ -201,7 +201,7 @@ fn public_video_cenc() {
201201
for kid_id in pssh.kid {
202202
assert_eq!(kid_id, kid);
203203
}
204-
assert_eq!(pssh.data.len(), 0);
204+
assert!(pssh.data.is_empty());
205205
assert_eq!(pssh.box_content, pssh_box);
206206
}
207207
}

mp4parse_capi/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,8 @@ fn create_sample_table(track: &Track, track_offset_time: i64) -> Option<Vec<mp4p
991991

992992
let iter = sort_table.iter();
993993
for i in 0 .. (iter.len() - 1) {
994-
let current_index = sort_table[i] as usize;
995-
let peek_index = sort_table[i + 1] as usize;
994+
let current_index = sort_table[i];
995+
let peek_index = sort_table[i + 1];
996996
let next_start_composition_time = sample_table[peek_index].start_composition;
997997
let sample = &mut sample_table[current_index];
998998
sample.end_composition = next_start_composition_time;

0 commit comments

Comments
 (0)