windows server 2003镜像_Rust学习笔记-2.1 rustup 镜像加速,飞起

348bcda0f0c3ed4bedb9b765c275b9eb.png

在安装rust的时候和更新rust依赖的时候在国内我们可能会遇到下载奇慢的问题.

这个时候可以通过配置镜像站点,加速加载.

rustup(rust-init) 加速

Windows 下 如果发现rust-init.exe 不能成功下载工具链,一直卡在下载上.
此时可以打开CMD

set RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static

set RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup

C:甥敳獲aron900Downloads>set RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-staticC:甥敳獲aron900Downloads>set RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustupC:甥敳獲aron900Downloads>"rustup-init (1).exe"Welcome to Rust!This will download and install the official compiler for the Rustprogramming language, and its package manager, Cargo.It will add the cargo, rustc, rustup and other commands toCargo's bin directory, located at:  C:甥敳獲aron900.cargobinThis can be modified with the CARGO_HOME environment variable.Rustup metadata and toolchains will be installed into the Rustuphome directory, located at:  C:甥敳獲aron900.rustupThis can be modified with the RUSTUP_HOME environment variable.This path will then be added to your PATH environment variable bymodifying the HKEY_CURRENT_USER/Environment/PATH registry key.You can uninstall at any time with rustup self uninstall andthese changes will be reverted.Current installation options:   default host triple: x86_64-pc-windows-msvc     default toolchain: stable               profile: default  modify PATH variable: yes1) Proceed with installation (default)2) Customize installation3) Cancel installation>1info: profile set to 'default'info: default host triple is x86_64-pc-windows-msvcinfo: syncing channel updates for 'stable-x86_64-pc-windows-msvc'467.6 KiB / 467.6 KiB (100 %) 340.0 KiB/s in  2s ETA:  0sinfo: latest update on 2020-08-27, rust version 1.46.0 (04488afe3 2020-08-24)info: downloading component 'cargo'info: downloading component 'clippy'info: downloading component 'rust-docs'info: downloading component 'rust-std'info: downloading component 'rustc'info: downloading component 'rustfmt'info: installing component 'cargo'info: installing component 'clippy'info: installing component 'rust-docs' 12.6 MiB /  12.6 MiB (100 %)   5.3 MiB/s in  2s ETA:  0sinfo: installing component 'rust-std'info: installing component 'rustc' 39.5 MiB /  39.5 MiB (100 %)  14.3 MiB/s in  2s ETA:  0sinfo: installing component 'rustfmt'info: default toolchain set to 'stable'  stable installed - rustc 1.46.0 (04488afe3 2020-08-24)Rust is installed now. Great!To get started you need Cargo's bin directory (%USERPROFILE%.cargobin) in yourPATHenvironment variable. Future applications will automatically have thecorrect environment, but you may need to restart your current shell.Press the Enter key to continue.

下载速度飞起!!

fbc17875fca4816c019dec61b69c04ec.png

crate.io 镜像加速(Rust Crates 源加速)

在 $HOME/.cargo/config 中添加如下内容,如果不存在就新创建一个 config 文件.

[source.crates-io]replace-with = 'ustc'[source.ustc]registry = "git://mirrors.ustc.edu.cn/crates.io-index"

如果你的网络环境不支持git的话,可以把registry替换成:

registry = "https://mirrors.ustc.edu.cn/crates.io-index"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值