1
0
Fork 0

Move main to better spot

This commit is contained in:
Vivianne 2022-12-10 14:58:00 -08:00
parent 8bc501a4f5
commit 916e8e1b6f
1 changed files with 15 additions and 13 deletions

View File

@ -116,20 +116,7 @@ mod parsing {
}
}
fn main() {
let filename = "etc/p07.txt";
let file = fs::File::open(filename).expect("Can't open file");
let lines: Vec<String> = io::BufReader::new(file)
.by_ref()
.lines()
.flatten()
.collect();
println!("PART ONE ---------------");
part1(&lines);
println!("\n PART TWO ---------------");
part2(&lines);
}
use parsing::{line, Command, Line, Listing};
use path_clean::clean;
@ -280,6 +267,21 @@ impl State {
}
}
fn main() {
let filename = "etc/p07.txt";
let file = fs::File::open(filename).expect("Can't open file");
let lines: Vec<String> = io::BufReader::new(file)
.by_ref()
.lines()
.flatten()
.collect();
println!("PART ONE ---------------");
part1(&lines);
println!("\n PART TWO ---------------");
part2(&lines);
}
fn part1(lines: &[String]) {
let mut state = State::new();