From 45d52390dd69f80c3171f2feaf67ab1e90f64086 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Fri, 9 Dec 2022 09:06:37 +0000 Subject: [PATCH] fix: a couple of compiler warnings on previous days --- src/bin/day_6.rs | 2 +- src/bin/day_8.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/day_6.rs b/src/bin/day_6.rs index bcb0d5d..f561e65 100644 --- a/src/bin/day_6.rs +++ b/src/bin/day_6.rs @@ -7,7 +7,7 @@ fn parse(s: &str) -> Result { } #[aoc(day = 6, parse = parse, test_cases = ["day_6_1.txt", "day_6_2.txt", "day_6_3.txt", "day_6_4.txt"])] -fn day_6(mut input: Input) -> Result<()> { +fn day_6(input: Input) -> Result<()> { // Part 1 for i in 4..input.len() { let s = &input[i - 4..i]; diff --git a/src/bin/day_8.rs b/src/bin/day_8.rs index 16704be..98665f9 100644 --- a/src/bin/day_8.rs +++ b/src/bin/day_8.rs @@ -80,12 +80,12 @@ fn day_8(input: Input) -> Result<()> { // Part 2 let mut highest_score = 0; for x in 1..(width - 1) { - 'y:for y in 1..(height - 1) { + for y in 1..(height - 1) { let h = input[y][x]; let mut score = 1; - 'u: { + { // up let mut distance = 0; let mut y = y; @@ -99,7 +99,7 @@ fn day_8(input: Input) -> Result<()> { score *= distance; } - 'u: { + { // down let mut distance = 0; let mut y = y; @@ -113,7 +113,7 @@ fn day_8(input: Input) -> Result<()> { score *= distance; } - 'u: { + { // left let mut distance = 0; let mut x = x; @@ -127,7 +127,7 @@ fn day_8(input: Input) -> Result<()> { score *= distance; } - 'u: { + { // right let mut distance = 0; let mut x = x;