MCPcopy Create free account
hub / github.com/SandmeyerX/rustlings-zh-cn

github.com/SandmeyerX/rustlings-zh-cn @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
773 symbols 1,009 edges 188 files ⚖ MIT 73 documented · 9% updated 4d agov1.0.0 · 2026-08-23★ 1412 open issues

Browse by type

Functions 673 Types & classes 100
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rustlings-zh-cn 🦀❤️

Tracking Status

[!NOTE] 新版 Rustlings 的 README 文件移除了以下内容,取而代之的是网站链接:Rustlings 🦀 这里为了直观地展示安装步骤,保留了原版内容的翻译

欢迎使用 Rustlings 练习题简体中文版 😃 这个项目包含一些小练习,来帮助你习惯阅读和编写惯用的 Rust 代码。 也包括如何阅读编译器提示并据此修改代码!

建议在做 Rustlings 练习的同时阅读 《Rust 程序设计语言》(The Rust Book)(社区中文翻译,原文:The Rust Book),这是学习 Rust 最全面的资源📚️

Rust By Example(社区中文翻译,原文:Rust By Example)是另一个推荐的资源,可能会对你有帮助。 它包含了与 Rustlings 类似的代码示例和练习,但适合在线上使用。

✨ 如有任何问题,请在 issues 中联系我们

入门指南

安装 Rust

在安装 Rustlings 之前,需要安装 最新版本的 Rust。 访问 www.rust-lang.org/tools/install 以获取安装 Rust 的更多说明。 这同时将安装 Rust 的包/项目管理器 Cargo

🐧 如果使用 Linux,请确保已安装 gcc(用于链接器)。

Deb:sudo apt install gcc。 Dnf:sudo dnf install gcc

🍎 如果使用 macOS,请通过运行 xcode-select --install 确保已安装 Xcode 及其开发工具。

安装 Rustlings

以下命令将下载并编译 Rustlings:

cargo install rustlings

如果安装失败…点击展开

  • 通过运行 rustup update 确保您拥有最新的 Rust 版本
  • 尝试添加 --locked 标志:cargo install rustlings --locked
  • 否则,请 报告问题

下载练习题

安装 Rustlings 后,运行以下命令将简体中文版练习题下载到本地:

git clone https://github.com/SandmeyerX/rustlings-zh-cn.git --depth 1

或者点击这里下载最新版压缩包

开始练习

练习题下载完成后,在解压后的练习题根目录下运行以下命令:

rustlings

如果提示找不到命令rustlings(command cannot be found)…点击展开

可能使用的是 Linux 并通过包管理器安装了 Rust。 Cargo 将二进制文件安装到 ~/.cargo/bin 目录。 遗憾的是,包管理器通常不会将 ~/.cargo/bin 添加到您的 PATH 环境变量中。

解决方案是…

  • 手动将 ~/.cargo/bin 添加到 PATH
  • 或者从包管理器中卸载 Rust,并使用官方的 rustup 方式安装:https://www.rust-lang.org/tools/install

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 612
Method 61
Class 58
Enum 30
Interface 12

Languages

Rust100%

Modules by API surface

solutions/23_conversions/try_from_into.rs18 symbols
exercises/23_conversions/try_from_into.rs18 symbols
solutions/18_iterators/iterators5.rs17 symbols
exercises/18_iterators/iterators5.rs16 symbols
solutions/23_conversions/from_into.rs15 symbols
exercises/23_conversions/from_into.rs15 symbols
solutions/23_conversions/from_str.rs14 symbols
exercises/23_conversions/from_str.rs14 symbols
solutions/13_error_handling/errors6.rs13 symbols
solutions/18_iterators/iterators3.rs12 symbols
exercises/18_iterators/iterators3.rs12 symbols
solutions/08_enums/enums3.rs11 symbols

For agents

$ claude mcp add rustlings-zh-cn \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page