Macro aoc_macros::run_bytes[][src]

run_bytes!() { /* proc-macro */ }
Expand description

Runs a given function with byte input

Usage:

run_bytes!(year, day, part, function, input_path);

eg.

run_bytes!(2021, 1, 1, year2020::day1::part1, "input/2020/1.bin")

The function may also be a string literal. The _bytes version calls the function with a &u8

The function should be able to take in a &[u8] and output something which is displayable eg.

fn example(input: &[u8]) -> impl std::fmt::Display {
    ...
}

input_path must be a path to a file containing the input into the function