From c79e950ca22c7a957c11e510700664327b042115 Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 26 Aug 2024 14:08:07 +0300 Subject: Appease most clippy warnings The warnings only remain in places where I need them to remain, because I either need a reminder to implement something, or I need to refactor and simplify the code in question. --- templates/build.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/build.rs b/templates/build.rs index bdf99fa..ac77059 100644 --- a/templates/build.rs +++ b/templates/build.rs @@ -22,7 +22,7 @@ fn main() -> Result<(), std::io::Error> { println!("cargo:rerun-if-changed=assets/"); let assets_path = std::path::Path::new("assets"); - let mut assets = WalkDir::new(&assets_path) + let mut assets = WalkDir::new(assets_path) .into_iter(); while let Some(Ok(entry)) = assets.next() { if entry.file_type().is_dir() { @@ -64,19 +64,19 @@ fn main() -> Result<(), std::io::Error> { .write(true) .open(&gzip_path)?; - let mut in_file = std::fs::File::open(&normal_path)?; + let mut in_file = std::fs::File::open(normal_path)?; let mut encoder = Encoder::new(&mut out_file)?; std::io::copy(&mut in_file, &mut encoder)?; encoder.finish().into_result()?; } - let normal_len: f64 = std::fs::metadata(&normal_path).unwrap().len() as f64; + let normal_len: f64 = std::fs::metadata(normal_path).unwrap().len() as f64; let gzipped_len: f64 = std::fs::metadata(&gzip_path).unwrap().len() as f64; let ratio = gzipped_len / normal_len; eprintln!("Ratio: {}", ratio); if ratio <= 0.9 { - std::fs::remove_file(&normal_path)? + std::fs::remove_file(normal_path)? } else { println!( "cargo:warning={} compression ratio is {} (> 0.9), leaving as is", -- cgit 1.4.1