2.6. Running a Rust program
Run your Rust project by using the Cargo build tool. Cargo first rebuilds your project and then runs the resulting executable file. If used during development, the cargo run command correctly resolves the output path independently of the build mode.
Prerequisites
Procedure
To run a Rust program managed as a project by Cargo, enter in the project directory:
$ cargo runIf your program has not been built yet, Cargo builds your program before running it.