How it works...
In this recipe, we created a simple binary project (step 2 and step 4) together with a library project (step 3 and step 5) that depend on each other. We simply specify these dependencies in their Cargo.toml files in step 6 and the workspace we created in step 7 helps us to join the projects together. Now, any commands are run on the projects that support them.
By building this project (with cargo run, cargo test, or cargo build), the tool creates a file containing the current dependency tree (called Cargo.lock). As a workspace, the output directory for the binaries (target/) is also located in the workspace directory instead of the individual projects' directories. Let's check the contents of the directories to see what that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access