summaryrefslogtreecommitdiffstats
path: root/2015/rs/code/four
diff options
context:
space:
mode:
authoralyx <alyx@aleteoryx.me>2023-11-20 17:52:42 -0500
committeralyx <alyx@aleteoryx.me>2023-11-20 17:52:42 -0500
commitb17f7207359cb2059dd7277f9ec816921147c485 (patch)
treebfb3e41ef432f6c0b685f17ac9742e4e3109cbe1 /2015/rs/code/four
parentccf1a5828fc26a82545c7accf1ce7916daa08a2d (diff)
downloadadventofcode-b17f7207359cb2059dd7277f9ec816921147c485.tar.gz
adventofcode-b17f7207359cb2059dd7277f9ec816921147c485.tar.bz2
adventofcode-b17f7207359cb2059dd7277f9ec816921147c485.zip
remove warnings
Diffstat (limited to '2015/rs/code/four')
-rw-r--r--2015/rs/code/four/src/main.rs12
1 files changed, 6 insertions, 6 deletions
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;