#
知识 2024-08-01

rust 更换国内源

By alex 641 Views 3 MIN READ 0 Comments

服务介绍
由于国内拉取 crates.io 以及安装 Rust 会面临流量出境不稳定的问题,我们提供了一个国内镜像代理以帮助国内 Rust 生态发展,欢迎大家使用。
配置说明
步骤一:设置 Rustup 镜像, 修改配置 ~/.zshrc or ~/.bashrc (配置环境变量)

export RUSTUP_DIST_SERVER="https://rsproxy.cn"
export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"

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

[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

参考 https://rsproxy.cn/#getStarted

本文由 alex 原创

采用 CC BY-NC-SA 4.0 协议进行许可

转载请注明出处:https://blog.laialex.com/archives/167/

TAGS: 无标签

YOU MAY ALSO LIKE

  • 暂无相关推荐,看看别的吧。

0 COMMENTS

LEAVE A REPLY