Add template and utils library.
This commit is contained in:
parent
f2caf1d0cb
commit
355f5f6628
6
2022/src/template.rs
Normal file
6
2022/src/template.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
mod utils;
|
||||||
|
|
||||||
|
pub fn execute() -> Result<(), io::Error> {
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
12
2022/src/utils.rs
Normal file
12
2022/src/utils.rs
Normal 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}");
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user