This is the code repository for Zero 2 Production, a book about building production-ready applications in Rust.
The code in this repository is organized in chapters, each of which is a Cargo workspace. To run the code in a chapter, cd
into the chapter directory and run cargo run
.
# Run all tests
cargo test
# Run all tests in a chapter
cargo test -p chapter_01
# Run a single test
cargo test -p chapter_01 -- test_name
# Install tarpaulin
cargo install cargo-tarpaulin
# Run tarpaulin
cargo tarpaulin --all --out Html
# Open the coverage report
open tarpaulin-report.html
# Install clippy
rustup component add clippy
# Run clippy
cargo clippy
# Run clippy and fail the pipeline if there are warnings
cargo clippy -- -D warnings
# Install rustfmt
rustup component add rustfmt
# Run rustfmt
cargo fmt
# Run rustfmt and fail the pipeline if there are warnings
cargo fmt -- --check
# Install cargo audit
cargo install cargo-audit
# Run cargo audit
cargo audit
# Install cargo geiger
cargo install cargo-geiger
# Run cargo geiger
cargo geiger
```bash
# Install cargo nightly
rustup toolchain install nightly --allow-downgrade
# Run cargo nightly
cargo +nightly build
```
```bash
# Install cargo watch
cargo install cargo-watch
# Run cargo watch
cargo watch -x build
```
```bash
# Install cargo udeps
cargo install cargo-udeps
# Run cargo udeps
cargo +nightly udeps
```
tracing
open telemetry jeager honeycomb
User stroies:
- As a blog visitor, I want to subscribe to the newsletter so that I can receive updates about new blog posts.
- As a blog visitor, I want to unsubscribe from the newsletter so that I don't receive updates about new blog posts.
- As a blog author, I want to send emails to subscribers so that I can notify them about new blog posts.