Solutions in Rust.
├── common/ # Shared utilities
├── day01/ # Day 1 solution
├── day02/ # Day 2 solution
└── inputs/ # Input files (gitignored)
# Run a day's solution
cargo run -p day01
# Run tests
cargo test -p day01
# Run all tests
cargo test --workspace
# Check formatting
cargo fmt --all
# Run clippy
cargo clippy --workspace
# Watch mode (requires: cargo install cargo-watch)
cargo watch -c -x 'run -p day01' # Watch and run
cargo watch -c -x 'test -p day01' # Watch and test
cargo watch -c -x 'test --workspace' # Watch all tests- Create
dayXX/Cargo.toml:
[package]
name = "dayXX"
version.workspace = true
edition.workspace = true
[dependencies]
common = { path = "../common" }
- Create
dayXX/src/main.rswith solution - Add
"dayXX"to workspace members in rootCargo.toml - Add input to
inputs/dayXX.txt