Search⌘ K

Using Cargo to Build, Check, or Run our Project

Explore how to use Cargo commands to build and manage your Rust projects. Learn to check for errors quickly, build and run in both debug and release modes, clean build artifacts, and maintain consistent code formatting using Cargo's built-in tools. This lesson helps you streamline your development process and ensure your Rust game projects are well structured and optimized.

We’ve now become familiar with Cargo. Cargo offers a few other ways to interact with our program. We can type cargo help for a full list or cargo [command] --help for detailed help about a command’s options. We can:

  • Quickly check to see if a project is valid by typing cargo check. This checks our project and its dependencies for basic structural errors, typically much faster than a full build.

  • Compile without running our project with cargo build.

  • Remove the entire ...