rust 很不错,但是crates 经常下载有点慢,当前阿里云还没有相关的镜像,还有科大为我们提供了一个
配置方法
- 添加crates 配置
$HOME/.cargo/config 目录
[registry]
index = "git://mirrors.ustc.edu.cn/crates.io-index"
说明:
如果不支持git 协议,可以使用http
index = "http://mirrors.ustc.edu.cn/crates.io-index"
cargo 0.13.0 以及高版本的,配置如下:
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
一个下载效果
Downloaded serde v1.0.81 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded semver-parser v0.7.0 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded syntex_syntax v0.42.0 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded term v0.4.6 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded rand_pcg v0.1.1 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded unicode-xid v0.0.3 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded regex-syntax v0.5.6 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded memoffset v0.2.1 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded syntex_pos v0.42.0 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded rand v0.5.5 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded stable_deref_trait v1.1.1 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded tokio-io v0.1.10 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded arrayvec v0.4.9 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded rand_core v0.2.2 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
参考资料
https://lug.ustc.edu.cn/wiki/mirrors/help/rust-crates