pub fn run() -> Result<(), Box<dyn Error>>Expand description
Run the Advent of Code solution based on command line arguments.
This should be used in the main function of the binary crate that wires
together your solutions. It:
- Parses the command line using
clap. - Locates the registered solution for the requested day/part/year.
- Loads the input (either from
--input-fileor, if theaoc-clientfeature is enabled, remotely from Advent of Code). - Optionally publishes the answer when
--publishis used and theaoc-clientfeature is enabled. - Prints the resulting answer to stdout.
§Errors
Returns an error if input reading or (when enabled) communication with Advent of Code fails. If no matching solution is found, this function will panic.
§Examples
fn main() -> Result<(), Box<dyn std::error::Error>> {
aoc_star::run()
}