增加cargo 代理或者变更下载crate的仓库地址

添加代理

  1. 在cargo下创建config
    vi ~/.cargo/config
    
  2. 添加代理
    [http]
    proxy = "127.0.0.1:7891"
    [https]
    proxy = "127.0.0.1:7891"
    

修改下载仓库

  1. 添加配置到~/.cargo/config
    [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"
    
  2. 执行命令
    cargo install tauri-cli --version "^1.0.0"