From b17f7207359cb2059dd7277f9ec816921147c485 Mon Sep 17 00:00:00 2001 From: alyx Date: Mon, 20 Nov 2023 17:52:42 -0500 Subject: remove warnings --- 2015/rs/code/four/src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '2015/rs/code/four/src') diff --git a/2015/rs/code/four/src/main.rs b/2015/rs/code/four/src/main.rs index 177ddc5..0888816 100644 --- a/2015/rs/code/four/src/main.rs +++ b/2015/rs/code/four/src/main.rs @@ -9,16 +9,16 @@ fn main() { buf.extend_from_slice(INPUT); for i in 0.. { - if i % 1000 == 0 { print!("{i}\r"); std::io::stdout().flush(); } + if i % 1000 == 0 { print!("{i}\r"); let _ = std::io::stdout().flush(); } let mut hasher = Md5::new(); - write!(&mut buf, "{i}"); + let _ = write!(&mut buf, "{i}"); hasher.update(buf.as_slice()); let hash = hasher.finalize(); if hash.starts_with(&[0, 0]) && hash[2] < 16 { let mut hexhash = String::with_capacity(32); for digit in hash { - write!(&mut hexhash, "{digit:02x}"); + let _ = write!(&mut hexhash, "{digit:02x}"); } println!("Got 5 digit hash: {hexhash}, at {i}"); break; @@ -27,16 +27,16 @@ fn main() { } for i in 0.. { - if i % 1000 == 0 { print!("{i}\r"); std::io::stdout().flush(); } + if i % 1000 == 0 { print!("{i}\r"); let _ = std::io::stdout().flush(); } let mut hasher = Md5::new(); - write!(&mut buf, "{i}"); + let _ = write!(&mut buf, "{i}"); hasher.update(buf.as_slice()); let hash = hasher.finalize(); if hash.starts_with(&[0, 0, 0]) { let mut hexhash = String::with_capacity(32); for digit in hash { - write!(&mut hexhash, "{digit:02x}"); + let _ = write!(&mut hexhash, "{digit:02x}"); } println!("Got 6 digit hash: {hexhash}, at {i}"); break; -- cgit v1.2.3-54-g00ecf