Rust crates.io换国内镜像源

由于众所周知的原因,crates.io在国内访问十分糟糕,轻则编译缓慢,要很久很久,重则直接超时报错,编译不了.

下面就为rust crates.io换上国内中科大的源

1. 进入当前用户的 .cargo 目录 cd ~/.cargo


2. 新建名字叫 config 的文件


3. 编辑 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"

Rust crates.io换国内镜像源

======= end ======


参考中科大官方说明:
https://lug.ustc.edu.cn/wiki/...

相关推荐