From 65cf48a0072df02fe422aeeef31c416ad8791a08 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Sat, 11 Feb 2023 00:01:46 -0800 Subject: [PATCH] small clippy fixes --- src/http.rs | 2 +- src/log.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/http.rs b/src/http.rs index 5da2ff1a..8b72f0fe 100644 --- a/src/http.rs +++ b/src/http.rs @@ -148,7 +148,7 @@ fn submit_request(prep: RequestPrep) -> Result { } if let Some(output_filename) = prep.output_filename { - let mut writer = std::io::BufWriter::new(std::fs::File::create(&output_filename)?); + let mut writer = std::io::BufWriter::new(std::fs::File::create(output_filename)?); std::io::copy(&mut response, &mut writer)?; writer.flush()?; } else { diff --git a/src/log.rs b/src/log.rs index 9bd019b2..de45fc0b 100644 --- a/src/log.rs +++ b/src/log.rs @@ -31,12 +31,12 @@ byond_fn!(fn log_write(path, data, ...rest) { // write first line, timestamped let mut iter = data.split('\n'); if let Some(line) = iter.next() { - write!(file, "[{}] {}\n", Utc::now().format("%F %T%.3f"), line)?; + writeln!(file, "[{}] {}", Utc::now().format("%F %T%.3f"), line)?; } // write remaining lines for line in iter { - write!(file, " - {}\n", line)?; + writeln!(file, " - {}", line)?; } }