Revert "Remove env stuff from input reading"

I remember now. This was so I can `cargo run bigboy_input` without code changes
This commit is contained in:
kageru 2021-12-01 14:12:36 +01:00
parent 63c695608e
commit 250bad526c

View File

@ -1,5 +1,13 @@
use std::env;
pub fn read_file(day: usize) -> String {
std::fs::read_to_string(format!("inputs/day{:0>2}", day)).unwrap()
std::fs::read_to_string(
env::args()
.nth(1)
.filter(|n| n != "--bench")
.unwrap_or_else(|| format!("inputs/day{:0>2}", day)),
)
.unwrap()
}
#[inline]