Skip to main content

aoc

Attribute Macro aoc 

Source
#[aoc]
Expand description

§Attribute for the solver functions

This attribute can accept up to 3 arguments.

  • Day: mandatory following the syntax dayN where N is in [1, 25]
  • Part: optional following the syntax partN where N is in [1, 2]
  • Name: optional a string typically used for alternate solution implementations.

yaah will match the solver method to the first matching triple in this order:

  1. exact match for Day/Part/Name
  2. exact match for Day/Part
  3. exact match for Day
  4. use the raw &'static str input.

The return type of a solution must implement Display. If it is an Option or a Result, then the caller will grace fully stop if None or Err(_) is returned.

§Example

use aoc_helper::aoc;

#[aoc(day3, part2, named_solution)]
pub fn my_fancy_solution(input: &SomeType) -> AnotherType {
    todo!()
}