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)

相关推荐
布莱克60515 分钟前
Swift 方法详解:实例方法、类型方法与 mutating 机制
服务器·开发语言·ios·ssh·swift·方法
Risehuxyc2 小时前
PHP能不能在参数里放匿名函数
开发语言·php
码云社区2 小时前
Java家政服务系统源码:人员技能、服务范围与多商家业务落地
java·开发语言·家政服务·家政小程序·家政系统
FRing033 小时前
vue3干货总结3(defineOptions(Vue3.3)、defineModel(Vue3.4)、Pinia)
开发语言·前端·vue.js·vue3
Sashtok3 小时前
cpp基础知识(10)
c++·后端
xjz18423 小时前
Rust 的`+=`、`-=`、`*=`、`/=` —— 让变量更新更简洁
rust
行百里er4 小时前
【Spring Insight 技术分享】runtime-settings.json 的妙用
后端·开源·监控
whitelbwwww4 小时前
CUDA C++实战--中级
开发语言·前端·c++
FungLeo5 小时前
FengCMS · PHP+MySQL 升级实录 · 内容写入一致性:锁等待超时与跨模型子树删除竞态
开发语言·mysql·php·工程实践·fengcms
databook5 小时前
处理一批 PDF,怎么算真的处理完了
后端·python