aoc-star-derive

Crates.ioaoc-star-derive
lib.rsaoc-star-derive
version0.1.1
created_at2025-12-15 21:58:20.946491+00
updated_at2025-12-16 17:43:32.153481+00
descriptionMacro to flag functions as Advent of Code solutions
homepagehttps://github.com/Yag000/aoc-star/tree/main/aoc-star-derive
repositoryhttps://github.com/Yag000/aoc-star/tree/main/aoc-star-derive
max_upload_size
id1986825
size26,506
Yago Iglesias (Yag000)

documentation

https://docs.rs/aoc-star-derive

README

aoc-star-derive

Procedural macro crate for aoc-star.

You normally don't use this crate directly. Instead, depend on aoc-star, and import the star attribute from there:

use aoc_star::star;

#[star(day = 1, part = 1, year = 2024)]
fn solve_day1_part1(input: String) -> String {
    // ...
    "answer".to_string()
}

The star attribute:

  • Registers the annotated function as an Advent of Code solution for a given day, part, and optional year.
  • Ensures that the function has the correct signature: it must accept a single String argument (the puzzle input) and return a String (the answer).
  • Uses the inventory crate to make the solution discoverable at runtime.
Commit count: 51

cargo fmt