Skip to content

Latest commit

 

History

History

rust

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Advent of Code Rust Solutions

2023 Rust Progress

Day Part One Part Two
Day 1 - -
Day 2 - -
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2022 Rust Progress

Day Part One Part Two
Day 1 - -
Day 2 - -
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2021 Rust Progress

Day Part One Part Two
Day 1 - -
Day 2 - -
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2020 Rust Progress

Day Part One Part Two
Day 1 - -
Day 2 - -
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2019 Rust Progress

Day Part One Part Two
Day 1 1.6μs* 3.6μs*
Day 2 2.2μs* 1ms*
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2018 Rust Progress

Day Part One Part Two
Day 1 13μs 12.2μs
Day 2 - -
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2017 Rust Progress

Day Part One Part Two
Day 1 51μs* 59μs*
Day 2 - -
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2016 Rust Progress

Day Part One Part Two
Day 1 - -
Day 2 - -
Day 3 - -
Day 4 - -
Day 5 - -
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

2015 Rust Progress

Day Part One Part Two
Day 1 6.2μs* 1.9μs*
Day 2 194μs* 196μs*
Day 3 231μs* 256μs*
Day 4 506ms 14s
Day 5 193μs 4ms
Day 6 - -
Day 7 - -
Day 8 - -
Day 9 - -
Day 10 - -
Day 11 - -
Day 12 - -
Day 13 - -
Day 14 - -
Day 15 - -
Day 16 - -
Day 17 - -
Day 18 - -
Day 19 - -
Day 20 - -
Day 21 - -
Day 22 - -
Day 23 - -
Day 24 - -
Day 25 - -

Setup

  1. Install Rust

  2. Open with VS Code

  3. Install the suggested extensions when prompted (Recommended)

  4. Install the required crates

    cargo build

    Select Current Rust Cargo launch option. F5 runs the cargo you're focusing in debug mode. Set Rust to default to nightly

    rustup default nightly

Debug

Since CodeLLDB does not play well with cargo workspaces use the Debug or Run codelense from the rust-analyser VS Code extension

Running individual days

cargo run -p aoc201601

Testing

Run in the cargo you'd like to test

cargo test

Or in the workspace cargo if you'd like to run all tests

cargo test --all

Benchmarking

Run a specific days benchmark

cargo bench -p aoc201501

Or in the workspace cargo if you'd like to run all benchmarks (Takes a while!)

cargo bench --all

Scaffolding

cargo run -p scaffold 2016 01

Requirements

  • OpenSSL dev libraries

    To install on Ubuntu:

    sudo apt install libssl-dev pkg-config

Notes

Rustfmt's config file is symlinked to the repository root because the rust-analyser extension can't pick it up otherwise.

The github action actions-rs/cargo@v1 cannot be run in a subdirectory either so --manifest-path has to be set for each step.

The github action actions-rs/audit-check@v1 is disabled because it too cannot be run in a subdirectory but additional argument cannot be passed until this pr is merged. Until that, this step is done manually.