Rust解决cargo build太慢

替换crates仓库源

  1. 打开或新建用户目录下/.cargo/config文件
  2. 在文件中增加配置
[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"
  1. 保存退出

你可能感兴趣的:(Rust,编程语言,Rust,编程语言)