Cargo字节镜像源

在 Windows 系统默认为:%USERPROFILE%.cargo,在类 Unix 系统默认为:$HOME/.cargo,在此目录下新建config文件,填写内容如下:

php 复制代码
[source.crates-io]
replace-with = 'rsproxy'

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"

# 稀疏索引,要求 cargo >= 1.68
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

[net]
git-fetch-with-cli = true

源替换:

source.crates-io\]:这一部分指定了 crates.io 作为默认源。 replace-with = 'rsproxy':这行配置表示将 crates.io 源替换为 rsproxy。 **自定义源配置:** \[source.rsproxy\]:定义了一个名为 rsproxy 的源。 registry = "https://rsproxy.cn/crates.io-index":指定了 rsproxy 源的注册表 URL。 **稀疏索引配置(需要 Cargo 1.68 及以上版本):** \[source.rsproxy-sparse\]:定义了一个名为 rsproxy-sparse 的源,用于稀疏索引。 registry = "sparse+https://rsproxy.cn/index/":指定了稀疏索引源的注册表 URL。 **注册表配置:** \[registries.rsproxy\]:定义了一个名为 rsproxy 的注册表。 index = "https://rsproxy.cn/crates.io-index":指定了注册表的索引 URL。 **网络配置:** \[net\]:定义了网络相关的配置。 git-fetch-with-cli = true:这行配置指定了在处理 git 依赖时使用命令行工具。 丰富内容

相关推荐
a cool fish(无名)9 小时前
rust-方法语法
开发语言·后端·rust
a cool fish(无名)1 天前
rust-参考与借用
java·前端·rust
叶 落1 天前
[Rust 基础课程]猜数字游戏-获取用户输入并打印
rust·rust基础
RustFS1 天前
RustFS 如何修改默认密码?
rust
景天科技苑1 天前
【Rust线程池】如何构建Rust线程池、Rayon线程池用法详细解析
开发语言·后端·rust·线程池·rayon·rust线程池·rayon线程池
该用户已不存在2 天前
Zig想要取代Go和Rust,它有资格吗
前端·后端·rust
用户1774125612442 天前
不懂装懂的AI,折了程序员的阳寿
rust
量子位3 天前
vivo自研蓝河操作系统内核开源!Rust开发新机遇来了
rust·ai编程
祈澈菇凉3 天前
rust嵌入式开发零基础入门教程(六)
stm32·单片机·rust
祈澈菇凉3 天前
rust嵌入式开发零基础入门教程(二)
开发语言·后端·rust