rust更换镜像源

 

在~/.cargo下新建一个config文件

 

 里面粘贴如下代码

[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"

重新>cargo run会发现速度快多了

 

posted on 2022-05-06 15:39  风中狂笑  阅读(476)  评论(0编辑  收藏  举报

导航