Installation
Use this to install Rust
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | shThen, make sure Cargo is also installed with
$ cargoLastly, make sure that rustc is installed by running
$ rustc --version and launch the book by doing $ rustup docs --bookCreating a hello-world rust program
First make a new directory
$ mkdir hello world. Then, move to the directory and create a main.rs file. Add the following code to itfn main() {
println!("Hello, world!");
}After doing this, compile the rust file into a binary by running
$ rustc main.rsFinally, run the binary with
$ ./mainUsing Cargo
Cargo does build and package management for rust. Think of it as a npm/pip for Rust