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 依赖时使用命令行工具。 丰富内容

相关推荐
Source.Liu13 小时前
【Python基础】 13 Rust 与 Python 注释对比笔记
开发语言·笔记·python·rust
Source.Liu17 小时前
【Python基础】 19 Rust 与 Python if 语句对比笔记
笔记·python·rust
Source.Liu18 小时前
【Python基础】 18 Rust 与 Python print 函数完整对比笔记
笔记·python·rust
学渣676561 天前
文件传输工具rsync|rust开发环境安装|Ascend实验相关命令
开发语言·后端·rust
咸甜适中2 天前
rust语言 (1.88) egui (0.32.1) 学习笔记(逐行注释)(二十四)窗口颜色、透明度、居中显示
笔记·学习·rust·egui
或与且与或非2 天前
Rust+slint实现一个登录demo
开发语言·rust·状态模式
BoredWait2 天前
rust 嵌入式esp23 《直流电机》
rust·嵌入式
l1t2 天前
DuckDB新版rusty_sheet 插件测试
xml·数据库·rust·插件·xlsx·duckdb
万添裁2 天前
移动语义:从C++到rust
c++·rust·移动语义
EthanChou20203 天前
rust学习之开发环境
开发语言·学习·rust