rust换源

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

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-2allsobaiduend~default-1-129145764-null-null.142v93insert_down1&utm_term=rust 换源&spm=1018.2226.3001.4187)

你可能感兴趣的:(Rust,rust,开发语言,后端)