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"])]
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];

View file

@ -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;