Instead of changing the main.rs file every day, I'll suggest creating a separate file for each day inside src/bin directory. That way, you can execute them using cargo run --bin day_1. Small but well thought out features like this is why I love Rust so much. For example, you can look at my repo at github.com/shritesh/advent-of-code
I hope to get through all of the challenges this year and learn from everyone here.
Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
I'm doing AoC with Rust too and the solution I came up with looks almost exactly like yours.
Part 1
Part 2: I used a HashSet
Instead of changing the main.rs file every day, I'll suggest creating a separate file for each day inside
src/bin
directory. That way, you can execute them usingcargo run --bin day_1
. Small but well thought out features like this is why I love Rust so much. For example, you can look at my repo at github.com/shritesh/advent-of-codeI hope to get through all of the challenges this year and learn from everyone here.
Oooh! Good idea! I’m definitely doing that. Thanks!