summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2021-12-01 13:17:27 +0100
committerGard Spreemann <gspr@nonempty.org>2021-12-01 13:17:27 +0100
commitf27d934298c268710797136de6be698251f95b68 (patch)
tree9c61b96926c12f526f2c9a8c4fc6db5daada24a7
parent4ac44435935cae94c3444726b70219fd4a5c6223 (diff)
Remove leftover type conversion
-rw-r--r--01/src/part-2.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/01/src/part-2.rs b/01/src/part-2.rs
index c9ea298..66532ef 100644
--- a/01/src/part-2.rs
+++ b/01/src/part-2.rs
@@ -11,7 +11,7 @@ pub fn main() {
for (i, line) in handle.lines().enumerate() {
let depth: u64 = line.unwrap().parse().unwrap();
- let j: usize = ((i+1) % 4) as usize; // Currently inactive window.
+ let j = (i+1) % 4; // Currently inactive window.
for k in 0..j { depths[k] += depth; }
for k in (j+1)..min(i+1, 4) { depths[k] += depth; } // min(i+1, 4) to special-case the first 4 lines.
if depths[(j+1) % 4] > depths[j] { count += 1; }