mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-11-10 06:34:18 +00:00
io: Prevent unstable_name_collisions
This commit is contained in:
parent
bfae8baf7a
commit
c2f711a81f
4 changed files with 5 additions and 8 deletions
|
@ -44,8 +44,7 @@ where
|
|||
size = size.saturating_add(32);
|
||||
}
|
||||
|
||||
#[allow(unstable_name_collisions)]
|
||||
if u64::from(size) > data.stream_len()? {
|
||||
if u64::from(size) > data.stream_len_hack()? {
|
||||
decode_err!(@BAIL Ape, "APE tag has an invalid size (> file size)");
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,7 @@ where
|
|||
R: Read + Seek,
|
||||
{
|
||||
pub(super) fn new(mut reader: R, parse_mode: ParsingMode) -> Result<Self> {
|
||||
#[allow(unstable_name_collisions)]
|
||||
let len = reader.stream_len()?;
|
||||
let len = reader.stream_len_hack()?;
|
||||
Ok(Self {
|
||||
reader,
|
||||
start: 0,
|
||||
|
@ -185,7 +184,7 @@ where
|
|||
R: Read + Seek,
|
||||
{
|
||||
let mut reader = AtomReader::new(data, parse_options.parsing_mode)?;
|
||||
let file_length = reader.stream_len()?;
|
||||
let file_length = reader.stream_len_hack()?;
|
||||
|
||||
let ftyp = verify_mp4(&mut reader)?;
|
||||
|
||||
|
|
|
@ -20,8 +20,7 @@ where
|
|||
let mut version = MpcStreamVersion::Sv4to6;
|
||||
let mut file = MpcFile::default();
|
||||
|
||||
#[allow(unstable_name_collisions)]
|
||||
let mut stream_length = reader.stream_len()?;
|
||||
let mut stream_length = reader.stream_len_hack()?;
|
||||
|
||||
// ID3v2 tags are unsupported in MPC files, but still possible
|
||||
#[allow(unused_variables)]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// TODO: https://github.com/rust-lang/rust/issues/59359
|
||||
pub(crate) trait SeekStreamLen: std::io::Seek {
|
||||
fn stream_len(&mut self) -> crate::error::Result<u64> {
|
||||
fn stream_len_hack(&mut self) -> crate::error::Result<u64> {
|
||||
use std::io::SeekFrom;
|
||||
|
||||
let current_pos = self.stream_position()?;
|
||||
|
|
Loading…
Reference in a new issue