Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use byteorder::{ReadBytesExt, WriteBytesExt, BE};
use std::collections::HashMap;
use std::convert::TryInto;
use std::io::{Read, Write};
use std::iter::repeat;

// BlockType {{{
/// Types of blocks. Used primarily to map blocks to block identifiers when reading and writing.
Expand Down Expand Up @@ -533,11 +532,7 @@ impl CueSheet {
assert!(self.catalog_num.len() <= 128);

bytes.extend(self.catalog_num.clone().into_bytes());
bytes.extend(
repeat(0)
.take(128 - self.catalog_num.len())
.collect::<Vec<u8>>(),
);
bytes.extend(std::iter::repeat_n(0, 128 - self.catalog_num.len()).collect::<Vec<u8>>());
bytes.extend(self.num_leadin.to_be_bytes().iter());

let mut flags = 0;
Expand All @@ -557,8 +552,7 @@ impl CueSheet {
bytes.push(track.number);
bytes.extend(track.isrc.clone().into_bytes().into_iter());
bytes.extend(
repeat(0)
.take(12 - track.isrc.len())
std::iter::repeat_n(0, 12 - track.isrc.len())
.collect::<Vec<u8>>()
.into_iter(),
);
Expand Down