mac or linux
$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env
$ rustup update
$ rustup self uninstall
$ rustc --version
cargo
$ cargo --version
$ cargo new hello_cargo
$ cd hello_cargo
$ cargo build
Compiling hello_cargo v0.1.0 (/Users/mahao/rust/src/hello_cargo)
Finished dev [unoptimized + debuginfo] target(s) in 0.82s
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/hello_cargo`
Hello, world!
$ cargo check
Checking hello_cargo v0.1.0 (/Users/mahao/rust/src/hello_cargo)
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
$ cargo build --release
网友评论