run

Function run 

Source
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:

  1. Parses the command line using clap.
  2. Locates the registered solution for the requested day/part/year.
  3. Loads the input (either from --input-file or, if the aoc-client feature is enabled, remotely from Advent of Code).
  4. Optionally publishes the answer when --publish is used and the aoc-client feature is enabled.
  5. 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()
}