学习rust
2023更新
- 这本不错 https://course.rs/about-book.html
- 加了代理
cat $HOME/.cargo/config.toml
[source.crates-io]
replace-with = 'rsproxy'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
# 稀疏索引,要求 cargo >= 1.68
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true
rust 编程
- 安装
curl https://sh.rustup.rs -sSf | sh - 第一个程序
cargo new hello --bin - 查看项目中依赖模块的帮助文档
cargo doc --open - 入门书籍
- The Rust Programming Language, 打开本地版本
rustup docs --book - 中文翻译 https://kaisery.github.io/trpl-zh-cn/ch08-01-vectors.html
- The Rust Programming Language, 打开本地版本
其他命令
- 查看版本
rustc --version && cargo --version - 依赖包更新
cargo update - 运行
cargo build && cargo run或者cargo run
--- 她说, 她是仙,她不是神

浙公网安备 33010602011771号