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=%7B%22request%5Fid%22%3A%22169373099616800182723958%22%2C%22scm%22%3A%2220140713.130102334...%22%7D\&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)

相关推荐
Demon--hx1 小时前
[C++]迭代器
开发语言·c++
倚肆1 小时前
Spring Boot 中的 Bean 与自动装配详解
spring boot·后端·python
BanyeBirth1 小时前
C++窗口问题
开发语言·c++·算法
q***06292 小时前
PHP进阶-在Ubuntu上搭建LAMP环境教程
开发语言·ubuntu·php
g***96902 小时前
【Spring Boot 实现 PDF 导出】
spring boot·后端·pdf
charlie1145141913 小时前
从 0 开始:在 WSL + VSCode 上利用 Maven 构建 Java Spring Boot 工程
java·笔记·vscode·后端·学习·maven·springboot
k***3884 小时前
SpringBoot Test详解
spring boot·后端·log4j
z***89715 小时前
SpringBoot Maven 项目 pom 中的 plugin 插件用法整理
spring boot·后端·maven
郝学胜-神的一滴5 小时前
Qt的QSlider控件详解:从API到样式美化
开发语言·c++·qt·程序人生
学困昇5 小时前
C++11中的{}与std::initializer_list
开发语言·c++·c++11