Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit b519cd7

Browse files
committed
fix: Issues reported by clippy
1 parent 8f1760c commit b519cd7

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/chunk.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ impl ChunkHeader {
312312
///
313313
/// # Arguments
314314
///
315-
/// * `reader` - The input stream. The reader must be positioned right after the root
316-
/// chunk header.
317-
/// * `end` - The stream position where the chunk sequence ends. This is used to
318-
/// prevent searching past the end.
315+
/// * `reader`: The input stream. The reader must be positioned right after the root chunk
316+
/// header.
317+
/// * `end`: The stream position where the chunk sequence ends. This is used to prevent
318+
/// searching past the end.
319319
pub fn find_id3<F, R>(reader: R, end: u64) -> crate::Result<Self>
320320
where
321321
F: ChunkFormat,
@@ -329,11 +329,11 @@ impl ChunkHeader {
329329
///
330330
/// # Arguments
331331
///
332-
/// * `tag` - The chunk tag to search for.
333-
/// * `reader` - The input stream. The reader must be positioned at the start of a
334-
/// sequence of chunks.
335-
/// * `end` - The stream position where the chunk sequence ends. This is used to
336-
/// prevent searching past the end.
332+
/// * `tag`: The chunk tag to search for.
333+
/// * `reader`: The input stream. The reader must be positioned at the start of a sequence of
334+
/// chunks.
335+
/// * `end`: The stream position where the chunk sequence ends. This is used to prevent
336+
/// searching past the end.
337337
fn find<F, R>(tag: &ChunkTag, mut reader: R, end: u64) -> crate::Result<Option<Self>>
338338
where
339339
F: ChunkFormat,

src/stream/tag.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use bitflags::bitflags;
88
use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
99
use std::cmp;
1010
use std::fs;
11-
use std::io::{self, Read, Write};
11+
use std::io::{self, Read, Seek, Write};
1212
use std::ops::Range;
1313
use std::path::Path;
1414

@@ -479,7 +479,9 @@ impl Default for Encoder {
479479
}
480480
}
481481

482-
pub fn locate_id3v2(mut reader: impl io::Read + io::Seek) -> crate::Result<Range<u64>> {
482+
pub fn locate_id3v2(reader: impl io::Read + io::Seek) -> crate::Result<Range<u64>> {
483+
let mut reader = io::BufReader::new(reader);
484+
483485
let header = Header::decode(&mut reader)?;
484486

485487
let tag_size = header.tag_size();

0 commit comments

Comments
 (0)