Creating a single project is easy: run cargo new my-crate and it's done. cargo creates everything from folder structure to a small source file (or unit test) in a breeze. However, what about larger projects consisting of multiple smaller crates and an executable? Or just a collection of related libraries? The cargo tool's answer to this is called workspaces.
Organizing large projects with workspaces
How to do it...
Follow these steps to create your own workspace to manage multiple projects:
- In a Terminal window (Windows PowerShell or a Terminal on macOS/Linux), change to a directory that will hold the workspace by running these commands:
$ mkdir -p my-workspace
$ cd my-workspace
- Use the cargo new command followed...