pub fn download_inputs(root_dir: &str, token: &str, year: i16) -> Option<()>Expand description
Downloads input files for year’s Advent of Code. Should be called from build.rs build script.
root_dir should be set to env!("CARGO_MANIFEST_DIR"), this directory is used as parent for input/ folder and for reading src/.
Downloaded input files will be placed to root_dir/input and called dayXX.txt where XX is day’s number.
token is AoC’s cookie called session. You can find it in your browser.
When year is smaller than 2015 or greater than current year, build script will report an error as AoC for that year doesn’t exist.
To download a day, there needs to exist file root_dir/dayXX.rs where XX is day’s number.
If the input file is not yet released or the file for the day does not exist, it will issue a warning and continue.
It will also report any IO or network errors that occurred while fetching and saving input files.