Learning Rust by implementing solutions for Advent of Code problems.
Simply execute:
cargo test
If you want to get the result for only one project run:
cargo test --package y2022day01
To get for example the result of part 1 of day 1, run:
cargo run --package y2022day01 --bin part-02
Cd into the specific year folder (e.g. 2022
) and run:
cargo new --lib day-NN
Replace NN
with the number of day for the given year. For instance:
cargo new --lib day-01
Then add part-01 and part-02 binaries.
Finally add the new subproject in the workspace by editing the main Cargo.toml
. For instance, assuming you just created 2022/day-10
:
[workspace]
members = [
"2022/day-01",
# ...
"2022/day-10" # <- new entry
]
To get for example the benchmark result ofday 1, run:
cargo bench --package y2022day01
Licensed under MIT License.
See also https://github.com/lmammino/rust-advent