Skip to content

Instantly share code, notes, and snippets.

@chengpeiquan
Created May 7, 2022 02:47
Show Gist options
  • Save chengpeiquan/b18a4cc712a78a67f36067b33466b0ff to your computer and use it in GitHub Desktop.
Save chengpeiquan/b18a4cc712a78a67f36067b33466b0ff to your computer and use it in GitHub Desktop.

编辑 ~/.cargo/config ,修改第 3 - 5 行:

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'tuna'
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

替换为以下其中一个源:

# 清华大学
replace-with = 'tuna'
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

# 中国科学技术大学
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

# 上海交通大学
replace-with = 'sjtu'
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"

# rustcc社区
replace-with = 'rustcc'
[source.rustcc]
registry = "git://crates.rustcc.cn/crates.io-index"

# 阿里云源
replace-with = 'rustcc'
[source.rustcc]
registry = "https://code.aliyun.com/rustcc/crates.io-index.git"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment