summaryrefslogtreecommitdiffstats
path: root/2015/rs/code/four/src
diff options
context:
space:
mode:
Diffstat (limited to '2015/rs/code/four/src')
-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;