Skip to content
ADHDecode
  1. Home
  2. Articles
  3. Cargo

Cargo Articles

51 articles

Cargo.lock Explained: When to Commit It and Why It Matters

Cargo.lock Explained: When to Commit It and Why It Matters — Cargo.lock is actually a guarantee that your Rust builds will be reproducible, not just a r...

2 min read

Detect Undefined Behavior in Rust with cargo miri

Detect Undefined Behavior in Rust with cargo miri. Miri is a Rust interpreter that finds undefined behavior in your code. Let's see Miri in action

4 min read

Create Well-Structured Rust Projects with cargo new

cargo new is the command-line tool for creating new Rust projects. It's the foundational step for any new Rust development, setting up a basic project s.

3 min read

Run Rust Tests 3x Faster with cargo nextest

nextest is a test runner that can speed up Rust test execution by running tests in parallel and by intelligently skipping tests that are unlikely to fai.

3 min read

Build no_std Rust Crates for Embedded and WASM Targets

The primary surprise about nostd Rust is that it's not about removing standard library features, but about selecting which ones you need from a minimal,.

3 min read

Speed Up Rust Builds: cargo Flags and Profiling Tricks

Rust's compiler, rustc, is famously thorough, which makes for safe, performant code, but it can also make builds feel like they're happening in slow mot.

5 min read

Write Procedural Macros in Rust with a Cargo Workspace

Rust's procedural macros are a powerful tool for code generation, but setting them up within a Cargo workspace can initially feel like navigating a maze.

3 min read

Release Rust Binaries for Production with Optimized Profiles

Release Rust Binaries for Production with Optimized Profiles — practical guide covering cargo setup, configuration, and troubleshooting with real-world ...

3 min read

Tune Rust Build Profiles for Speed, Size, and Debug Info

Rust's build profiles aren't just about making your code faster or smaller; they're about controlling the trade-offs between development speed, binary s.

4 min read

Property-Based Testing in Rust with proptest and cargo test

Property-Based Testing in Rust with proptest and cargo test — practical guide covering cargo setup, configuration, and troubleshooting with real-world e...

2 min read

Publish Your Rust Crate to crates.io Step by Step

Publish Your Rust Crate to crates.io Step by Step — crates.io is the official Rust package registry, and publishing your crate there makes it accessible.

2 min read

Host a Private Cargo Registry for Internal Rust Crates

A private Cargo registry isn't just for keeping your proprietary Rust code out of public view; it's the linchpin for building and maintaining a robust, .

3 min read

Run Rust Binaries and Pass Arguments with cargo run

cargo run is the primary tool for building and executing Rust projects, but its ability to pass arguments to your binary is often overlooked, leading to.

2 min read

Run, Filter, and Debug Tests with cargo test

Running tests in Rust with cargo test is more than just a command; it's a powerful toolkit for understanding your code's behavior and pinpointing exactl.

3 min read

Cargo.toml Complete Guide: Dependencies, Features, and Profiles

Cargo.toml Complete Guide: Dependencies, Features, and Profiles — practical guide covering cargo setup, configuration, and troubleshooting with real-wor...

3 min read

Inspect and Trim Dependency Trees with cargo tree

cargo tree is the unsung hero for understanding and optimizing Rust project dependencies, and its most surprising trick is how it can reveal circular de.

4 min read

Write and Audit unsafe Rust Code Safely

Rust's unsafe keyword is often seen as a necessary evil, a way to escape the borrow checker's iron grip when you absolutely need to do something low-lev.

4 min read

Update Rust Dependencies Safely with cargo update

When you run cargo update, it doesn't just grab the latest versions of your dependencies; it can silently update them to incompatible versions, breaking.

3 min read

Vendor Dependencies for Offline Rust Builds with cargo vendor

cargo vendor is the tool for managing offline Rust builds, but it's not magic; it relies on your system's existing knowledge of where to find your depen.

3 min read

Compile Rust to WebAssembly with cargo and wasm-pack

Compile Rust to WebAssembly with cargo and wasm-pack — Rust code can run in your browser. Let's see it happen. Here's a simple Rust function that adds t...

2 min read

Auto-Rebuild Rust on File Changes with cargo watch

Auto-Rebuild Rust on File Changes with cargo watch — practical guide covering cargo setup, configuration, and troubleshooting with real-world examples.

3 min read

Manage a Rust Monorepo with Cargo Workspaces

Manage a Rust Monorepo with Cargo Workspaces — Rust's Cargo.toml files are great for managing dependencies, but when your project starts growing an.

3 min read

Yank a Broken crates.io Release Without Deleting It

Yank a Broken crates.io Release Without Deleting It — crates.io doesn't actually have a "yank" or "delete" button for releases, which is a problem when yo.

2 min read

Add Dependencies to Rust Projects with cargo add

Adding dependencies to Rust projects is surprisingly flexible, and cargo add isn't just for adding new crates; it's also your primary tool for managing .

3 min read

Test Async Tokio Code with cargo test

Testing asynchronous Rust code with Tokio can feel like a whole different ballgame than traditional synchronous testing.

4 min read

Audit Rust Dependencies for CVEs with cargo audit

cargo audit is your best friend for finding and fixing security vulnerabilities in your Rust projects, but it's not magic.

3 min read

Benchmark Rust Code with cargo bench and Criterion

Benchmark Rust Code with cargo bench and Criterion — practical guide covering cargo setup, configuration, and troubleshooting with real-world examples.

2 min read

Optimize Release Builds with Rust Compiler Flags

Rust’s rustc compiler has a surprising number of knobs to twist for release builds, and they can shave off significant time from your build process and .

3 min read

Write build.rs Scripts to Customize Rust Compilation

Write build.rs Scripts to Customize Rust Compilation — Rust's build.rs scripts are a powerful, yet often overlooked, mechanism for customizing your comp...

4 min read

Speed Up CI by Optimizing Cargo Build Cache

Your CI build is dragging, and you suspect cargo build is the culprit. The target/ directory, full of compiled artifacts, is growing and being rebuilt f.

5 min read

Use cargo check for Fast Compile-Time Feedback

cargo check is the Rust compiler's way of saying "I've seen your code, and I think it's probably okay, but I'm not going to do the heavy lifting of actu.

2 min read

Set Up Rust CI with GitHub Actions and cargo test

Rust CI with GitHub Actions and cargo test The most surprising thing about setting up CI for Rust projects is how often the simplest configuration revea.

3 min read

Lint Rust Code with cargo clippy and Fix All Warnings

Rust code will refuse to compile if cargo clippy finds any of its suggestions that are marked as "errors" which is the default severity for most clippy .

4 min read

Authenticate to Private Cargo Registries Securely

Private cargo registries are an essential part of securing your containerized applications, acting as the gatekeepers for your proprietary container ima.

3 min read

Cross-Compile Rust for Linux, Windows, and ARM with cargo

Rust's cross-compilation story is surprisingly smooth, but the real magic isn't just getting it to build; it's how cargo orchestrates the entire toolcha.

3 min read

Build Rust for Custom Targets with .json Target Specs

Rust's rustc is an incredibly flexible compiler, and it can generate code for a vast array of architectures and operating systems, not just the common o.

3 min read

Generate and Publish Rust Docs with cargo doc

Generating and publishing Rust documentation with cargo doc is surprisingly straightforward, but the real magic happens when you understand how it integ.

3 min read

Build Rust Apps in Docker with Multi-Stage Cargo Builds

The most surprising thing about building Rust apps in Docker using multi-stage builds is that the final image can be smaller than a single cargo build o.

3 min read

Flash Microcontrollers from Rust with cargo embed

Flash Microcontrollers from Rust with cargo-embed cargo-embed lets you flash and debug embedded Rust applications directly from your terminal, bypassing.

3 min read

Cargo Workflows for Large Rust Teams and Monorepos

Cargo Workflows for Large Rust Teams and Monorepos — practical guide covering cargo setup, configuration, and troubleshooting with real-world examples.

3 min read

Inject Environment Variables into Rust Builds via Cargo

Rust's build system, Cargo, has a surprisingly flexible mechanism for injecting environment variables directly into your build process, allowing for dyn.

3 min read

Understand extern crate and the Rust 2018 Module System

The extern crate keyword, once a staple of Rust, is largely a relic of the past, even though the compiler still understands it.

2 min read

Compile Rust Features Conditionally with Cargo Feature Flags

Rust's #cfg attribute is your go-to for conditionally compiling code based on build targets or environment variables, but for enabling or disabling spec.

3 min read

Auto-Fix Rust Warnings and Lint Errors with cargo fix

cargo fix is not a magic bullet for Rust warnings and lint errors; it's a targeted tool that applies specific, well-defined code transformations based o.

4 min read

Profile Rust Binaries with cargo flamegraph

Profile Rust Binaries with cargo flamegraph — practical guide covering cargo setup, configuration, and troubleshooting with real-world examples.

2 min read

Enforce Consistent Rust Formatting with cargo fmt

Rust code formatting can be a real headache, especially on larger teams. You've got people with different editor settings, different ideas of what "read.

3 min read

Fuzz Test Rust Code with cargo fuzz and libFuzzer

cargo fuzz is a powerful tool that leverages libFuzzer to automatically discover bugs in your Rust code by feeding it malformed or unexpected inputs.

3 min read

Get Started with Cargo: Build, Test, and Publish Rust Packages

Cargo, Rust's build system and package manager, is designed to make working with Rust projects incredibly smooth, but its real magic lies in how it abst.

2 min read

Speed Up Builds with Cargo Incremental Compilation

Cargo's incremental compilation is a game-changer for Rust development speed. It's not just about making builds faster; it's about making your inner loo.

3 min read

Configure Rust Linkers for Faster Builds and Smaller Binaries

Rust's default linker, ld or lld on macOS, is a solid workhorse, but it can become a significant bottleneck, especially for large projects, by being slo.

3 min read

Measure Rust Code Coverage with cargo llvm-cov

Rust code coverage reports are surprisingly easy to generate with cargo llvm-cov, and it works by instrumenting your compiled code to track which lines .

3 min read
ADHDecode

Complex topics, finally made simple

Courses

  • Networking
  • Databases
  • Linux
  • Distributed Systems
  • Containers & Kubernetes
  • System Design
  • All Courses →

Resources

  • Cheatsheets
  • Debugging
  • Articles
  • About
  • Privacy
  • Sitemap

Connect

  • Twitter (opens in new tab)
  • GitHub (opens in new tab)

Built for curious minds. Free forever.

© 2026 ADHDecode. All content is free.

  • Home
  • Learn
  • Courses
Esc
Start typing to search all courses...
See all results →
↑↓ navigate Enter open Esc close