From c38fe8bba595bc179a8806540ae360bd56e632c3 Mon Sep 17 00:00:00 2001 From: endernon Date: Wed, 25 Dec 2024 00:38:00 +0000 Subject: [PATCH] cargo clippy --fix ROUND 1 --- src/lib.rs | 4 ++-- src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8fd0021..fa34c5a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,7 +37,7 @@ impl Chunk { } } -pub fn fix(mut bytes: Vec) -> Vec { +pub fn fix(bytes: Vec) -> Vec { let mut bufread = Cursor::new(bytes); // read the png header @@ -47,7 +47,7 @@ pub fn fix(mut bytes: Vec) -> Vec { let mut chunks = Vec::new(); let mut lenbuf = [0; 4]; - while let Ok(_) = bufread.read_exact(&mut lenbuf) { + while bufread.read_exact(&mut lenbuf).is_ok() { let len = u32::from_be_bytes(lenbuf); let mut kind = [0; 4]; diff --git a/src/main.rs b/src/main.rs index eebecbe..0f492f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,8 +75,8 @@ fn main() { for thatpath in filelist { println!("Filename: {:?}", thatpath); - let frfr = read(thatpath.to_owned()).expect("wtf the path doesnt exist"); - let mut fr = lib::fix(frfr); + let frfr = read(&thatpath).expect("wtf the path doesnt exist"); + let fr = lib::fix(frfr); write(thatpath, fr).expect("file could not write btw"); } }