clippy: Use stream_position() to get current position

This commit is contained in:
Ian Hobson
2023-05-12 16:52:06 +02:00
parent 313f5408ca
commit 1234c897a3

View File

@@ -4,7 +4,7 @@ use std::path::Path;
use std::io::Cursor; use std::io::Cursor;
use std::io::SeekFrom; use std::io::SeekFrom;
use std::io::SeekFrom::{Current, Start}; use std::io::SeekFrom::Start;
use std::io::{BufReader, Read, Seek}; use std::io::{BufReader, Read, Seek};
use super::bext::Bext; use super::bext::Bext;
@@ -116,7 +116,7 @@ impl<R: Read + Seek> AudioFrameReader<R> {
let framed_bits_per_sample = self.format.block_alignment * 8 / self.format.channel_count; let framed_bits_per_sample = self.format.block_alignment * 8 / self.format.channel_count;
let tell = self.inner.seek(Current(0))?; let tell = self.inner.stream_position()?;
if (tell - self.start) < self.length { if (tell - self.start) < self.length {
for n in 0..(self.format.channel_count as usize) { for n in 0..(self.format.channel_count as usize) {
@@ -145,7 +145,7 @@ impl<R: Read + Seek> AudioFrameReader<R> {
let framed_bits_per_sample = self.format.block_alignment * 8 / self.format.channel_count; let framed_bits_per_sample = self.format.block_alignment * 8 / self.format.channel_count;
let tell = self.inner.seek(Current(0))?; let tell = self.inner.stream_position()?;
if (tell - self.start) < self.length { if (tell - self.start) < self.length {
for n in 0..(self.format.channel_count as usize) { for n in 0..(self.format.channel_count as usize) {