Last active
March 16, 2021 02:18
-
-
Save thkprado/be9e1fd3dad120405a2ff6d0b6bd7e82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install Rust: | |
$ sudo apt-get install libc-dev | |
$ curl https://sh.rustup.rs -sSf | sh | |
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | |
Update Rust: | |
$ rustup self update | |
$ rustup update | |
Rust is distributed on three different release channels: | |
stable, beta, and nightly. | |
rustup nightly: | |
Install: | |
$ rustup install nightly | |
Test rustup nightly: | |
$ rustup run nightly rustc --version | |
Switch to nightly globally: | |
$ rustup default nightly | |
Cargo: | |
$ cargo +nightly test | |
Compiling and Running (without Cargo): | |
$ rustc main.rs | |
$ ./main | |
Cargo: | |
Creating a Project: | |
$ cargo new hello_cargo --bin | |
$ cd hello_cargo | |
Building and Running a Project: | |
$ cargo build | |
$ ./target/debug/hello_cargo | |
$ cargo run | |
Building for Release: | |
$ cargo build --release | |
$ ./target/release/hello_cargo | |
Cargo as Convention: | |
$ git clone someurl.com/someproject | |
$ cd someproject | |
$ cargo build | |
cargo clippy as a subcommand: | |
# $ cargo +nightly install clippy | |
# $ cargo +nightly clippy | |
rustup update | |
rustup component add clippy | |
cargo clippy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment