-
Open a terminal.
-
Navigate to the project directory:
cd /home/mm/Desktop/Rust-I-learn -
Compile and run the program using Cargo:
cargo run
If you are not using Cargo, you can compile and run your Rust program using
rustc:rustc main.rs ./main
-
New project:
cargo new <project_name>
-
Build the project:
cargo build
-
Run the project:
cargo run
-
Test the project:
cargo test -
Check the project for errors without building:
cargo check
-
Add a dependency:
cargo add <dependency-name>
-
Update dependencies:
cargo update
-
Clean the project (remove build artifacts):
cargo clean