资讯动态

Rust配置国内源后快速升级教程

发布时间:2026/10/25 1:19:00 来源:尧图企业网站定制
一、配置国内镜像源在中国大陆使用 Rust 时,可以通过配置国内镜像源来加速下载和更新。1. Rustup 镜像配置编辑或创建~/.cargo/config.toml文件(Windows 在%USERPROFILE%\.cargo\config.toml),添加以下内容:中国科学技术大学 (USTC)源:[source.crates-io] replace-with = 'ustc' [source.ustc] registry = "git://mirrors.ustc.edu.cn/crates.io-index" [net] git-fetch-with-cli = true或者使用清华大学源:[source.crates-io] replace-with = 'tuna' [source.tuna] registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"2. Rustup 工具链镜像1). Linux/macOS系统(永久生效):将环境变量写入 shell 配置文件

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑