All projects and studies were done following the official Rust documentation: https://doc.rust-lang.org/book/title-page.html
Guide: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
- Create project with cargo
$ cargo new hello_cargo
$ cd hello_cargo
- Connect your repository
$ cargo new <path your directory>
- Building and executing a project with cargo:
$ cargo build
Compiling hello_cargo v0.1.0 (file:///projects/hello_cargo)
Finished dev [unoptimized + debuginfo] target(s) in 2.85 secs
$ ./target/debug/hello_cargo # or .\target\debug\hello_cargo.exe on Windows
Hello, world!
- Importantly, the best option is to use the command:
$ cargo check
This command checks your code, but it doesn't generate an executable, it just checks if your code is compiling
- Build for release, this command is used to build your project for delivery to the user, recommend using this command only when your project is ready.
$ cargo build --release
Feel free to share your tips! Let's learn Rust together! ๐ฆ