Cargo 依赖下载慢、设置镜像

在用户目录.cargo目录新建config文件,把以下配置复制到文件中

[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"
# 如果所处的环境中不允许使用 git 协议,可以把上面的地址改为
registry = "https://mirrors.ustc.edu.cn/crates.io-index"

参考:https://zhuanlan.zhihu.com/p/74875840?from_voters_page=true

原文地址:https://www.cnblogs.com/lautung/p/14348780.html