Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Rust Programming cheatsheet #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 60 additions & 0 deletions languages/rust.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// #############################################################################
// Rust CHEATSHEET (中文速查表) - by geometryolife (created on 2022/03/22)
// #############################################################################


// #############################################################################
// rustup - Rust 工具链安装器
// cargo - Rust 编译管理器、包管理器以及通用工具
// rustc - Rust 编译器
// rustdoc - Rust 文档工具
// #############################################################################


// #############################################################################
// Cargo 的常用命令
// #############################################################################
cargo [+toolchain] [OPTIONS] [SUBCOMMAND]
cargo build // 编译当前包
cargo check // 分析当前包,不会构建目标文件
cargo clean // 移除目标目录
cargo doc // 构建包依赖的文档
cargo new // 创建 cargo 包
cargo init // 在存在的目录创建 cargo 包
cargo run // 运行
cargo test // 测试
cargo bench // 性能测试
cargo update // 强制更新依赖
cargo install // 安装二进制文件,默认位置 $HOME/.cargo/bin
cargo uninstall // 卸载二进制文件
cargo search // 搜索注册的 crates
cargo publish // 打包上传 package 到注册表
cargo help <command> // 查看指定命令的详细信息


// #############################################################################
// rustup 的常用命令
// #############################################################################
rustup [FLAGS] [+toolchain] <SUBCOMMAND>
rustup show // 显示激活和已安装的工具链信息
rustup update // 更新 Rust 工具链和 rustup
rustup check // 检查更新信息
rustup default // 设置默认工具链
rustup set // 修改 rustup 设置
rustup help // 帮助信息


// #############################################################################
// rustc 的常用命令
// #############################################################################
rustc [OPTIONS] INPUT
rustc -h // 帮助信息


// #############################################################################
// 入门书籍
// #############################################################################
《Rust 权威指南》 // 官方教程(The Book)中文译本
《Rust 编程入门、实战与进阶》 // 结合 LeetCode 题的算法实践
《Rust 编程之道》 // Rust 进阶用书
《Rust 程序设计》