美文网首页
rust install and demo

rust install and demo

作者: allenhaozi | 来源:发表于2020-04-08 09:09 被阅读0次

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

相关文章

网友评论

      本文标题:rust install and demo

      本文链接:https://www.haomeiwen.com/subject/qnkzphtx.html