Hitchhiker's Guide to Zero to Production in Rust
Dec 21, 2025 - ⧖ 3 minReloaded
I'm beginning a 2nd run through of Zero to Production in Rust. Unlike the first time through, I'll stick with actix-web. The objective this time is to get a deeper understanding of the broad, baseline themes that are covered in each chapter. A secondary objective is to take a side quest or two where appropriate. For instance, rather than our API sending raw strings when it comes time to serve HTML, I'll do it with the tera templating crate.
Chapter 2 Thoughts
Chapter 2 is about project scaffolding and getting one's dev tooling off the ground. For the most part, I followed it. The following items stood out compared to last time. For a couple of aspects I decided to swap out for alternate tools.
Per Project Config
It wasn't clear to me, until just recently, that you can do project overrides of cargo configuration. Make a .cargo directory in your project, then add a config.toml with your specifics. The book highlights the utility of this to change the linker to lld. Previously, I recall doing this a the "global" level in my user account. It's nicer to do it locally IMHO.
As of the latest version of Rust (1.92), lld is at least native for Linux users. If you're on Windows or macOS you still need to configure manually.
Alternatives - Inner Development Loop
The book recommends cargo-watch to fuel the so-called inner development loop. I've known for a while cargo-watch is on its...last watch, so to speak. The author is not developing it any further, which you can read about in the cargo-watch documentation. The author names bacon as the spiritual successor. I've decided to use it going forward. It's a tad more complex than cargo-watch, but the complexity is worth it.
Install bacon following the guide on their website then, if you're using VS Code, keep a second terminal pane open and run bacon there. It will automatically do what cargo-watch did, and more.
Level Up - Testing
I'm fan of the cargo-nextest crate, which you can read about on their website. It's a drop-in replacement for vanilla cargo test and provides nicer and output and generally better information. It's also 3x faster than cargo test. I've only used it in a basic way up to now, but will see about diving in in more detail now. Bacon will use it if you have it installed.
Code Coverage
Previously, the book recommended cargo-tarpaulin. However this crate doesn't work on Windows and is only available on macOS or Linux. A newer, more flexible tool is introduced, cargo-llvm-cov. It works regardless of your OS and prints out a much nicer representation of test coverage, so that you can see the gaps at a glance.
Link to Progress So Far
I'll be sharing updated code to a repo on GitHub, here's where things stand after Chapter 2.