Windows rustup update 速度慢,使用字节跳动Rust镜像加速

不设置镜像加速rustup 更新升级会非常慢

同样的 在安装时也是如何!

 

RsProxy 字节跳动的Rust 镜像

 

Windows想要使用这个镜像需要按照官方提示去设置两个系统变量

分别为 

RUSTUP_DIST_SERVER

https://rsproxy.cn

RUSTUP_UPDATE_ROOT

https://rsproxy.cn/rustup

 

之后来到当前用户文件夹下修改cargo的配置文件(没有就创建一个)

C:\Users\你PC名\.cargo\config 这个文件

按照RsProxy的第三步提示将配置文件填写并保存到这个配置文件即可!

 

设置 crates.io 镜像, 修改配置 ~/.cargo/config,已支持git协议和sparse协议,>=1.68 版本建议使用 sparse-index,速度更快

rsproxy-sparse
[source.crates-io]
replace-with = 'rsproxy-sparse'
[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
rsproxy
[source.crates-io]
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

 

效果如下

 

posted @ 2023-11-17 19:27  letleon  阅读(1402)  评论(0编辑  收藏  举报