1. cargo的依赖库的默认源用的是https://crates.io/,但国内很多网络访问很慢
  2. 像python的pip和php的composer以及go都有国内的代理或镜像
  3. rust国内也有镜像源,中国科大的
  4. 设置cargo的国内镜像源
    • 在~/.cargo/目录下,建一个config文件,windows下注意不要有扩展名
    • 设置内容
[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"
# 如果所处的环境中不允许使用 git 协议,可以把上面的地址改为
# registry = "https://mirrors.ustc.edu.cn/crates.io-index"
#[http]
#check-revoke = false

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2022-02-09
  • 2022-02-09
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-03-11
猜你喜欢
  • 2022-02-04
  • 2021-11-22
  • 2021-07-23
  • 2021-12-19
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案