day01 both

This commit is contained in:
Johannes
2018-12-01 10:03:12 +01:00
commit cebb80763a
9 changed files with 1023 additions and 0 deletions

11
src/utils.rs Normal file
View File

@@ -0,0 +1,11 @@
use std::fs::File;
use std::io::prelude::*;
pub fn read_file(path: &str) -> String {
let mut f = File::open(path).expect(&format!("file '{}' not found", path));
let mut contents = String::new();
f.read_to_string(&mut contents)
.expect("something went wrong reading the file");
contents
}