使用国内镜像加速 Rustup 工具链更新 export RUSTUP_DIST_SERVER= export RUSTUP_UPDATE_ROOT= # 清华大学 RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup RUSTUP_UPDATE_ROOT=https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup # 中国科学技术大学 RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup # 上海交通大学 RUSTUP_DIST_SERVER=https://mirror.sjtu.edu.cn/rust-static RUSTUP_UPDATE_ROOT=https://mirror.sjtu.edu.cn/rust-static/rustup #rsproxy.cn RUSTUP_DIST_SERVER="https://rsproxy.cn" RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" 使用国内镜像加速 crate 拉取 # 放到 `%CARGO_HOME%/config` 文件中 cargo 1.68 版本开始支持稀疏索引:不再需要完整克隆 crates.io-index 仓库,可以加快获取包的速度。 如果您的 cargo 版本大于等于 1.68,可添加如下内容: [source.crates-io] # 指定镜像 replace-with = 'rsproxy' # 如:tuna、sjtu、ustc、rsproxy [source.tuna] registry = "sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/" [source.sjtu] registry = "sparse+https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/" [source.ustc] registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/" [source.rsproxy] registry = "sparse+https://rsproxy.cn/index/" [registries.rsproxy] index = "https://rsproxy.cn/crates.io-index" [net] git-fetch-with-cli = true 如小于1.68: [source.crates-io] # 指定镜像 replace-with = 'rsproxy' # 如:tuna、sjtu、ustc、rsproxy [source.tuna] registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git" [source.sjtu] registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index" [source.ustc] registry = "git://mirrors.ustc.edu.cn/crates.io-index" [source.rsproxy] registry = "https://rsproxy.cn/crates.io-index" [registries.rsproxy] index = "https://rsproxy.cn/crates.io-index" [net] git-fetch-with-cli = true