以下两种方案都是修改 ~/.cargo/config 或者 c:\users[user].cargo\config

方案一:使用代理

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"

[http]
proxy = "http://127.0.0.1:10801"

[https]
proxy = "http://127.0.0.1:10801"

方案二:使用镜像源

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'

[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

标签: none