Topic | Rust |
---|---|
Installation |
Rust: cargo, rustc, clippy
Download Rust.
That includes rustc - the rust compiler, cargo - a package manager, and other tools like clippy. This works for Windows and Linux.
Install Rust pluggin, RLS, from the pluggin dropdown in VSCode's left menu bar. That supports
intellisence and debugging. If you have any problems with that, this tutorial may help:
VSCode with Rust.
|
Work Flow |
Creating Projects:
In VS Code, open the parent folder where you want to create a new Rust project.
In the terminal issue the command:
That's why the new command ends with --name test_pkg. If you don't use a snake_case name
you will repeatedly get warnings about naming formats.
Now you can open the new folder from the File menu and run or start debugging. when you don't
need to debug just issue the command:
You create a library with the terminal command:
cargo builds the library starter code with test fixtures for unit tests. Once you have some
library code and corresponding tests, you run tests with the terminal command:
If you manually create an /examples folder as a sibling to the /src folder, you can put
demonstration code that uses the library and displays results on the termianl. To do that
use the command:
|
Building Applications |
|