fix: a couple of compiler warnings on previous days

This commit is contained in:
Ashhhleyyy 2022-12-09 09:06:37 +00:00
parent eafc13993b
commit 45d52390dd
Signed by: ash
GPG key ID: 83B789081A0878FB
2 changed files with 6 additions and 6 deletions

View file

@ -7,7 +7,7 @@ fn parse(s: &str) -> Result<Input> {
} }
#[aoc(day = 6, parse = parse, test_cases = ["day_6_1.txt", "day_6_2.txt", "day_6_3.txt", "day_6_4.txt"])] #[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 // Part 1
for i in 4..input.len() { for i in 4..input.len() {
let s = &input[i - 4..i]; let s = &input[i - 4..i];

View file

@ -80,12 +80,12 @@ fn day_8(input: Input) -> Result<()> {
// Part 2 // Part 2
let mut highest_score = 0; let mut highest_score = 0;
for x in 1..(width - 1) { 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 h = input[y][x];
let mut score = 1; let mut score = 1;
'u: { {
// up // up
let mut distance = 0; let mut distance = 0;
let mut y = y; let mut y = y;
@ -99,7 +99,7 @@ fn day_8(input: Input) -> Result<()> {
score *= distance; score *= distance;
} }
'u: { {
// down // down
let mut distance = 0; let mut distance = 0;
let mut y = y; let mut y = y;
@ -113,7 +113,7 @@ fn day_8(input: Input) -> Result<()> {
score *= distance; score *= distance;
} }
'u: { {
// left // left
let mut distance = 0; let mut distance = 0;
let mut x = x; let mut x = x;
@ -127,7 +127,7 @@ fn day_8(input: Input) -> Result<()> {
score *= distance; score *= distance;
} }
'u: { {
// right // right
let mut distance = 0; let mut distance = 0;
let mut x = x; let mut x = x;