rust换源

$HOME/.cargo/目录下建一个config文件。windows默认是C:\Users\user_name\.cargo

config文件输入:

config 复制代码
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
# 使用 replace-with指明默认源更换为'ustc'源
replace-with = 'ustc'

# `source` 就是存储有关要更换的来源名称
[source.ustc] # 定义了一个名为'ustc'的源
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

之后第一次用新源会进行更新替代,时间大概大概是几十秒到几分钟左右。

Rust编程之给cargo替换国内源_cargo换源_没刮胡子的博客-CSDN博客(https://blog.csdn.net/somken/article/details/129145764?ops_request_misc={"request_id"%3A"169373099616800182723958"%2C"scm"%3A"20140713.130102334..."}\&request_id=169373099616800182723958\&biz_id=0\&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend\~default-1-129145764-null-null.142^v93^insert_down1\&utm_term=rust 换源&spm=1018.2226.3001.4187)

相关推荐
xieliyu.7 小时前
Java算法精讲:双指针(二)
java·开发语言·算法
jeffer_liu7 小时前
Spring AI 生产级实战:裁判员
java·人工智能·后端·spring·大模型
何以解忧,唯有..7 小时前
Python包管理工具pip:从入门到精通
开发语言·python·pip
雪的季节7 小时前
RabbitMQ详解
开发语言
金銀銅鐵7 小时前
用 Tkinter 实现简单的猜数字游戏
后端·python
copyer_xyf8 小时前
Python 模块与包的导入导出
前端·后端·python
ice8130331818 小时前
【Python】Matplotlib折线图绘制
开发语言·python·matplotlib
夜微凉48 小时前
三、Spring
java·后端·spring
三品吉他手会点灯8 小时前
C语言学习笔记 - 44.运算符和表达式 - 运算符2 - 除法与取余运算符
c语言·开发语言·笔记·算法
copyer_xyf8 小时前
Python venv 虚拟环境
前端·后端·python