Add template and utils library.

This commit is contained in:
Anna Rose 2024-02-15 18:09:56 +00:00
parent f2caf1d0cb
commit 355f5f6628
2 changed files with 18 additions and 0 deletions

6
2022/src/template.rs Normal file
View File

@ -0,0 +1,6 @@
mod utils;
pub fn execute() -> Result<(), io::Error> {
Ok(())
}

12
2022/src/utils.rs Normal file
View File

@ -0,0 +1,12 @@
use std::io;
use std::io::prelude::*;
use std::fs::File;
fn read_lines(filename: &str) -> io::Result<impl Iterator<Item = io::Result<String>>> {
let file = File::open(filename)?;
Ok(io::BufReader::new(file).lines())
}
fn print_step(step: i8, value: u64) {
println!("Step {step} solution: {solution}");
}