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.3 小时前
UPD协议结构以及开发中注意事项
java·开发语言·笔记·java-ee
AINative软件工程3 小时前
Agent 上下文账本工程:别让工具结果把 128K 窗口塞成垃圾场
后端·架构·ai编程
卷无止境3 小时前
FastAPI 的 Request 类装了什么
后端·python
Yweir3 小时前
AI大模型开发-Python介绍、版本说明
开发语言·人工智能·python
程序员爱钓鱼3 小时前
Rust 方法 Method详解:self、方法调用与API设计
后端·面试·rust
橙子家3 小时前
MSDTC(微软分布式事务处理协调器)对系统稳定性的影响
后端
程序员爱钓鱼3 小时前
Go break、continue、goto 详解
后端·面试·go
凤山老林4 小时前
复杂检索引擎落地:Spring Boot + Elasticsearch 数据同步与高阶查询实战
spring boot·后端·elasticsearch
峥嵘life11 小时前
Android16 311Y3 EAP-TLS 网络连接失败分析与修复总结
android·开发语言·人工智能·php
笃行35011 小时前
SQLServer数据迁移之后,那张报表还能不能秒出
后端