Skip to content

Commit 4f45ed2

Browse files
committed
Update day01 to read file at runtime instead of compile time
1 parent 2d4eb52 commit 4f45ed2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

day01/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ version = "0.1.0"
44
authors = ["Peter Goodspeed-Niklaus <[email protected]>"]
55

66
[dependencies]
7+
util = { path = "../util" }

day01/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
extern crate day01;
22
use day01::captcha_str;
33

4+
extern crate util;
5+
use util::read_file;
6+
47
fn main() {
5-
let input_str = include_str!("../input.txt").trim();
6-
println!("Captcha for input: {:?}", captcha_str(&input_str));
8+
let input = read_file("../input.txt");
9+
println!("Captcha for input: {:?}", captcha_str(input.trim()));
710
}

0 commit comments

Comments
 (0)