0%

Rust 初始化

学习 Rust。

加速安装

1
2
3
set RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
set RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/
rustup-init.exe

Cargo 配置

~/.cargo/config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 换源
[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"

# 静态链接 VC 运行时
# https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md
# https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0
[target.x86_64-pc-windows-msvc]
rustflags = ["-Ctarget-feature=+crt-static"]
[target.i686-pc-windows-msvc]
rustflags = ["-Ctarget-feature=+crt-static"]

The Rust Programming Language

官方文档

《Rust 程序设计语言》中文译本

打开离线版

1
rustup docs --book