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”

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

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

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理