Managing Projects with Cargo
Rust ships with a tool named Cargo that assists with your day-to-day interactions with the language. Cargo handles everything from making projects to fetching packages of pre-made code. It can run your programs and call other tools to fix your code formatting and find common errors. Cargo is a Swiss Army knife—it has a tool for everything.
Cargo derives its name from Rust’s structure. Rust programs are called crates. Collections of crates are managed by Cargo. This section walks you through creating your first Rust project and explores what Cargo can do for you.[7]
The first decision you need to make is, “Where do I put my Rust projects?”
Selecting a “Home” Directory for Your Code
You need to decide where you want ...
Get Hands-on Rust now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.