About
Hacking with Rust is a tutorial site for people who are learning Rust — or using Rust and getting stuck on the parts that are genuinely hard.
How the articles are written
Section titled “How the articles are written”Each article answers one question. It is written as a search result: you had a specific problem, you found the page, it gives you the working code and explains why it works.
Two rules apply to everything published here:
- Every code example is compiled and tested. If a snippet is supposed to fail to compile, the
page shows the real
rustcoutput, including the error code and the compiler’s own suggested fix. - No “just use
clone()” hand-waving. Where multiple fixes exist, the page explains the trade-off, because copying a value to silence the borrow checker is often the wrong answer.
Who this is for
Section titled “Who this is for”- Developers coming from Python, JavaScript, Go, C++ or Java who understand programming but not Rust’s ownership model.
- Students and self-taught programmers working through their first systems language.
- Rust users who are productive most days, but hit a wall every time lifetimes get involved.
If you have never programmed before, this site is a supplement rather than a starting point — work through The Rust Book alongside it.
Corrections
Section titled “Corrections”Spotted a mistake, an outdated compiler message, or an example that no longer compiles? That matters here more than almost anywhere else, because the whole claim of this site is that the code runs. Mail [email protected] with the page and what is wrong with it, and it gets fixed.