rust: Fix input paths for days 1 through 8

This commit is contained in:
Sijmen 2020-12-23 15:54:24 +01:00
parent 90e0a3060e
commit 02037cae7a
Signed by: vijfhoek
GPG Key ID: DAF7821E067D9C48
6 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
use std::{collections::HashMap, time::Duration, time::Instant};
pub fn run(print: bool) -> Duration {
let file_string = std::fs::read_to_string("inputs/day01").unwrap();
let file_string = std::fs::read_to_string("../inputs/01").unwrap();
let instant = Instant::now();
let entries: Vec<usize> = file_string.lines().flat_map(|line| line.parse()).collect();

View File

@ -1,7 +1,7 @@
use std::time::{Duration, Instant};
pub fn run(print: bool) -> Duration {
let file_string = std::fs::read_to_string("inputs/day02").unwrap();
let file_string = std::fs::read_to_string("../inputs/02").unwrap();
let instant = Instant::now();
let rules: Vec<(usize, usize, char, &str)> = file_string

View File

@ -16,7 +16,7 @@ fn count(rows: &[Vec<char>], dx: usize, dy: usize) -> usize {
}
pub fn run(print: bool) -> Duration {
let file_string = std::fs::read_to_string("inputs/day3").unwrap();
let file_string = std::fs::read_to_string("../inputs/03").unwrap();
let instant = Instant::now();

View File

@ -6,7 +6,7 @@ fn between(field: &str, lower: i32, higher: i32) -> bool {
}
pub fn run(print: bool) -> Duration {
let input = std::fs::read_to_string("inputs/day04").unwrap();
let input = std::fs::read_to_string("../inputs/04").unwrap();
let now = Instant::now();

View File

@ -1,7 +1,7 @@
use std::time::{Duration, Instant};
pub fn run(print: bool) -> Duration {
let input = std::fs::read_to_string("inputs/day05").unwrap();
let input = std::fs::read_to_string("../inputs/05").unwrap();
let instant = Instant::now();
let passes: Vec<_> = input.lines().collect();

View File

@ -62,7 +62,7 @@ fn part2(instructions: &[Instruction], skip: i32) -> Option<i32> {
}
pub fn run(print: bool) -> Duration {
let input = std::fs::read_to_string("inputs/day08").unwrap();
let input = std::fs::read_to_string("../inputs/08").unwrap();
let instant = Instant::now();
let instructions: Vec<_> = input