misc: Clippy

This commit is contained in:
Serial 2024-10-15 09:15:13 -04:00
parent 1954e2cde8
commit 13c5ff9938
No known key found for this signature in database
GPG key ID: DA95198DC17C4568
3 changed files with 12 additions and 12 deletions

View file

@ -746,7 +746,7 @@ where
}
}
impl<'a, R> Read for ElementChildIterator<'a, R>
impl<R> Read for ElementChildIterator<'_, R>
where
R: Read,
{
@ -755,7 +755,7 @@ where
}
}
impl<'a, R> Deref for ElementChildIterator<'a, R>
impl<R> Deref for ElementChildIterator<'_, R>
where
R: Read,
{
@ -766,7 +766,7 @@ where
}
}
impl<'a, R> DerefMut for ElementChildIterator<'a, R>
impl<R> DerefMut for ElementChildIterator<'_, R>
where
R: Read,
{
@ -775,7 +775,7 @@ where
}
}
impl<'a, R> Drop for ElementChildIterator<'a, R>
impl<R> Drop for ElementChildIterator<'_, R>
where
R: Read,
{

View file

@ -3,7 +3,7 @@ use crate::ebml::element_reader::{
ChildElementDescriptor, ElementChildIterator, ElementIdent, ElementReaderYield,
};
use crate::ebml::properties::EbmlProperties;
use crate::ebml::{AudioTrackDescriptor, VInt};
use crate::ebml::VInt;
use crate::error::Result;
use std::io::{Read, Seek};
@ -69,7 +69,7 @@ where
continue;
}
total_audio_data_size += (size.value() - header_size as u64);
total_audio_data_size += (size.value() - u64::from(header_size));
},
ElementIdent::BlockGroup => read_block_group(
&mut children_reader.children(),
@ -87,7 +87,7 @@ where
return Ok(());
}
let duration_millis = properties.duration().as_secs() as u128;
let duration_millis = u128::from(properties.duration().as_secs());
if duration_millis == 0 {
log::warn!("Duration is zero, cannot calculate bitrate");
return Ok(());
@ -95,7 +95,7 @@ where
let default_audio_track = &mut properties.audio_tracks[default_audio_track_position]; // TODO
let bitrate_bps = (((total_audio_data_size as u128) * 8) / duration_millis) as u32;
let bitrate_bps = ((u128::from(total_audio_data_size) * 8) / duration_millis) as u32;
default_audio_track.settings.bitrate = Some(bitrate_bps / 1000);
Ok(())
@ -144,7 +144,7 @@ where
continue;
}
*total_audio_data_size += (size.value() - header_size as u64);
*total_audio_data_size += (size.value() - u64::from(header_size));
}
Ok(())
@ -166,7 +166,7 @@ where
let track_number = VInt::<u64>::parse(children_reader, max_size_length)?;
let track_number_octets = track_number.octet_length();
children_reader.skip(block_size - track_number_octets as u64)?;
children_reader.skip(block_size - u64::from(track_number_octets))?;
if track_number != target_track_number {
return Ok((false, track_number_octets + NON_VARIABLE_BLOCK_HEADER_SIZE));
}

View file

@ -85,14 +85,14 @@ fn MKA_PROPERTIES() -> EbmlProperties {
},
extensions: Vec::new(),
segment_info: SegmentInfo {
timestamp_scale: 1000000,
timestamp_scale: 1_000_000,
muxing_app: String::from("Lavf60.3.100"),
writing_app: String::from("Lavf60.3.100"),
duration: Some(Duration::from_millis(1431)),
},
audio_tracks: vec![AudioTrackDescriptor {
number: 1,
uid: 18181673715630629642,
uid: 18_181_673_715_630_629_642,
enabled: true,
default: false,
language: Language::Iso639_2(String::from("und")),