Skip to content

Commit

Permalink
Make clippy happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Dec 10, 2023
1 parent da3c597 commit 5ee8316
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#![allow(clippy::nonminimal_bool)]
#![allow(clippy::tabs_in_doc_comments)]
#![allow(clippy::new_without_default)]
#![allow(clippy::partialeq_to_none)]

#![cfg_attr(docsrs, feature(doc_auto_cfg))]

Expand Down
4 changes: 2 additions & 2 deletions src/reading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ impl UntilPageHeaderReader {

let copy_amount = min(needed, fnd_buf.len());
let start_fill = 27 - needed;
(&mut self.ret_buf[start_fill .. copy_amount + start_fill])
(self.ret_buf[start_fill .. copy_amount + start_fill])
.copy_from_slice(&fnd_buf[0 .. copy_amount]);
// Comparison chain operation via cmp can be slower,
// and also requires an import. It's a questionable idea
Expand Down Expand Up @@ -988,7 +988,7 @@ impl<T :io::Read + io::Seek> PacketReader<T> {
let mut last_packet_end_pos = begin_pos;
tri!(self.rdr.seek(SeekFrom::Start(begin_pos)));
loop {
pos = tri!(self.rdr.seek(SeekFrom::Current(0)));
pos = tri!(self.rdr.stream_position());
pg = bt!(self.read_ogg_page());
/*println!("absgp {} pck_start {} whole_pck {} pck_end {} @ {} {}",
ab_of(&pg), pg.has_packet_start(), pg.has_whole_packet(),
Expand Down
6 changes: 3 additions & 3 deletions src/writing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl <'writer, T :io::Write> PacketWriter<'writer, T> {
hash_calculated = vorbis_crc32_update(0, hdr_cur.get_ref());
hash_calculated = vorbis_crc32_update(hash_calculated, pg_lacing);

for (idx, &(ref pck, _)) in pck_data.iter().enumerate() {
for (idx, (pck, _)) in pck_data.iter().enumerate() {
let mut start :usize = 0;
if idx == 0 { if let Some(idx) = pg.pck_last_overflow_idx {
start = idx;
Expand All @@ -262,7 +262,7 @@ impl <'writer, T :io::Write> PacketWriter<'writer, T> {
// Now all is done, write the stuff!
tri!(wtr.write_all(hdr_cur.get_ref()));
tri!(wtr.write_all(pg_lacing));
for (idx, &(ref pck, _)) in pck_data.iter().enumerate() {
for (idx, (pck, _)) in pck_data.iter().enumerate() {
let mut start :usize = 0;
if idx == 0 { if let Some(idx) = pg.pck_last_overflow_idx {
start = idx;
Expand Down Expand Up @@ -302,7 +302,7 @@ impl <'writer, T :io::Write> PacketWriter<'writer, T> {

impl<T :io::Seek + io::Write> PacketWriter<'_, T> {
pub fn get_current_offs(&mut self) -> Result<u64, io::Error> {
self.wtr.seek(SeekFrom::Current(0))
self.wtr.stream_position()
}
}

Expand Down

0 comments on commit 5ee8316

Please sign in to comment.