下载
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
更新rust版本
rustup update
创建新项目
cargo new projectname
换源
在~/.cargo目录下建立config
windows 下在C:\Users\hp.cargo\下
可以采用字节的 Rust 镜像,速度很不错,https://rsproxy.cn/
[source.crates-io]# To use sparse index, change 'rsproxy' to 'rsproxy-sparse'replace-with = 'rsproxy'[source.rsproxy]registry = "https://rsproxy.cn/crates.io-index"[source.rsproxy-sparse]registry = "sparse+https://rsproxy.cn/index/"[registries.rsproxy]index = "https://rsproxy.cn/crates.io-index"[net]git-fetch-with-cli = true
新版换源!!!crm
cargo install crmcrm best //自动选择最优的源crm default
自动找包
cargo-edit
需要7.0以上的openssl
https://github.com/killercup/cargo-edit
cargo install cargo-edit
source ~/.bashrc
cargo add
指定版本 指定features
cargo add reqwest@0.10 --features=blocking

