applied clippy
This commit is contained in:
parent
e230a5ce2c
commit
c6b8273d65
@ -21,7 +21,6 @@ fn main() {
|
||||
let file = File::open(FILE_PATH).expect("File measurements.txt not found");
|
||||
let mut reader = BufReader::new(&file);
|
||||
let file_length = reader.seek(SeekFrom::End(0)).unwrap();
|
||||
println!("file_length = {file_length}");
|
||||
let chunk_length = file_length as usize / cores;
|
||||
let mut bounds = Vec::with_capacity(cores + 1);
|
||||
bounds.push(0);
|
||||
@ -29,8 +28,8 @@ fn main() {
|
||||
let mut reader = BufReader::new(&file);
|
||||
let mut byte_start = chunk_length * i;
|
||||
reader.seek(SeekFrom::Start(byte_start as u64)).expect("could not seek");
|
||||
let mut bytes = reader.bytes();
|
||||
while let Some(byte) = bytes.next() {
|
||||
let bytes = reader.bytes();
|
||||
for byte in bytes {
|
||||
match byte {
|
||||
Ok(byte) => {
|
||||
byte_start += 1;
|
||||
|
@ -71,7 +71,7 @@ pub fn parse_temp(bytes: &[u8]) -> isize {
|
||||
#[inline]
|
||||
pub fn read_bytes_until(bytes: &mut Bytes<BufReader<&File>>, delimiter: u8) -> Option<Vec<u8>> {
|
||||
let mut buf: Vec<u8> = Vec::with_capacity(108);
|
||||
while let Some(byte) = bytes.next() {
|
||||
for byte in bytes {
|
||||
if byte.is_err() {
|
||||
panic!("Could not read byte");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user