diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 87f4ae1b..2e400eb1 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -96,64 +96,104 @@ - [Macro 宏编程](advance/macro.md) - + + - [易混淆概念解析](advance/confonding/intro.md) + - [切片和切片引用](advance/confonding/slice.md) + - [Eq 和 PartialEq](advance/confonding/eq.md) + - [String、&str 和 str todo](advance/confonding/string.md) + - [原生指针、引用和智能指针 todo](advance/confonding/pointer.md) + - [作用域、生命周期和 NLL todo](advance/confonding/lifetime.md) + - [move、Copy 和 Clone todo](advance/confonding/move-copy.md) + ## 专题内容,每个专题都配套一个小型项目进行实践 - - [自动化测试](test/intro.md) - [编写测试及控制执行](test/write-tests.md) - [单元测试和集成测试](test/unit-integration-test.md) - [断言 assertion](test/assertion.md) - [用 Github Actions 进行持续集成](test/ci.md) - [基准测试 benchmark](test/benchmark.md) + +- [Rust 异步编程](async-rust/intro.md) + - [async/await 异步编程](async-rust/async/intro.md) + - [async 编程入门](async-rust/async/getting-started.md) + - [底层探秘: Future 执行与任务调度](async-rust/async/future-excuting.md) + - [定海神针 Pin 和 Unpin](async-rust/async/pin-unpin.md) + - [async/await 和 Stream 流处理](async-rust/async/async-await.md) + - [同时运行多个 Future](async-rust/async/multi-futures-simultaneous.md) + - [一些疑难问题的解决办法](async-rust/async/pain-points-and-workarounds.md) + - [实践应用:Async Web 服务器](async-rust/async/web-server.md) + - [Tokio 使用指南](async-rust/tokio/intro.md) + - [tokio 概览](async-rust/tokio/overview.md) + - [使用初印象](async-rust/tokio/getting-startted.md) + - [创建异步任务](async-rust/tokio/spawning.md) + - [共享状态](async-rust/tokio/shared-state.md) + - [消息传递](async-rust/tokio/channels.md) + - [I/O](async-rust/tokio/io.md) + - [解析数据帧](async-rust/tokio/frame.md) + - [深入 async](async-rust/tokio/async.md) + - [select](async-rust/tokio/select.md) + - [类似迭代器的 Stream](async-rust/tokio/stream.md)) + - [优雅的关闭](async-rust/tokio/graceful-shutdown.md) + - [异步跟同步共存](async-rust/tokio/bridging-with-sync.md) -- [async/await 异步编程](async/intro.md) - - [async 编程入门](async/getting-started.md) - - [底层探秘: Future 执行与任务调度](async/future-excuting.md) - - [定海神针 Pin 和 Unpin](async/pin-unpin.md) - - [async/await 和 Stream 流处理](async/async-await.md) - - [同时运行多个 Future](async/multi-futures-simultaneous.md) - - [一些疑难问题的解决办法](async/pain-points-and-workarounds.md) - - [实践应用:Async Web 服务器](async/web-server.md) -- [Tokio 使用指南](tokio/intro.md) - - [tokio 概览](tokio/overview.md) - - [使用初印象](tokio/getting-startted.md) - - [创建异步任务](tokio/spawning.md) - - [共享状态](tokio/shared-state.md) - - [消息传递](tokio/channels.md) - - [I/O](tokio/io.md) - - [解析数据帧](tokio/frame.md) - - [深入 async](tokio/async.md) - - [select](tokio/select.md) - - [类似迭代器的 Stream](tokio/stream.md)) - - [优雅的关闭](tokio/graceful-shutdown.md) - - [异步跟同步共存](tokio/bridging-with-sync.md) - -- [Cargo 使用指南](cargo/intro.md) - - [上手使用](cargo/getting-started.md) - - [基础指南](cargo/guide/intro.md) - - [为何会有 Cargo](cargo/guide/why-exist.md) - - [下载并构建 Package](cargo/guide/download-package.md) - - [添加依赖](cargo/guide/dependencies.md) - - [Package 目录结构](cargo/guide/package-layout.md) - - [Cargo.toml vs Cargo.lock](cargo/guide/cargo-toml-lock.md) - - [测试和 CI](cargo/guide/tests-ci.md) - - [Cargo 缓存](cargo/guide/cargo-cache.md) - - [Build 缓存](cargo/guide/build-cache.md) - - [进阶指南](cargo/reference/intro.md) - - [指定依赖项](cargo/reference/specify-deps.md) - - [依赖覆盖](cargo/reference/deps-overriding.md) - - [Cargo.toml 清单详解](cargo/reference/manifest.md) - - [Cargo Target](cargo/reference/cargo-target.md) - - [工作空间 Workspace](cargo/reference/workspaces.md) - - [条件编译 Features](cargo/reference/features/intro.md) - - [Features 示例](cargo/reference/features/examples.md) - - [发布配置 Profile](cargo/reference/profiles.md) - - [通过 config.toml 对 Cargo 进行配置](cargo/reference/configuration.md) - - [发布到 crates.io](cargo/reference/publishing-on-crates.io.md) - - [构建脚本 build.rs](cargo/reference/build-script/intro.md) - - [构建脚本示例](cargo/reference/build-script/examples.md) - -- [手把手带你实现链表 doing](too-many-lists/intro.md) +- [Rust 工具链指南](toolchains/intro.md) + - [Cargo 使用指南](toolchains/cargo/intro.md) + - [上手使用](toolchains/cargo/getting-started.md) + - [基础指南](toolchains/cargo/guide/intro.md) + - [为何会有 Cargo](toolchains/cargo/guide/why-exist.md) + - [下载并构建 Package](toolchains/cargo/guide/download-package.md) + - [添加依赖](toolchains/cargo/guide/dependencies.md) + - [Package 目录结构](toolchains/cargo/guide/package-layout.md) + - [Cargo.toml vs Cargo.lock](toolchains/cargo/guide/cargo-toml-lock.md) + - [测试和 CI](toolchains/cargo/guide/tests-ci.md) + - [Cargo 缓存](toolchains/cargo/guide/cargo-cache.md) + - [Build 缓存](toolchains/cargo/guide/build-cache.md) + - [进阶指南](toolchains/cargo/reference/intro.md) + - [指定依赖项](toolchains/cargo/reference/specify-deps.md) + - [依赖覆盖](toolchains/cargo/reference/deps-overriding.md) + - [Cargo.toml 清单详解](toolchains/cargo/reference/manifest.md) + - [Cargo Target](toolchains/cargo/reference/cargo-target.md) + - [工作空间 Workspace](toolchains/cargo/reference/workspaces.md) + - [条件编译 Features](toolchains/cargo/reference/features/intro.md) + - [Features 示例](toolchains/cargo/reference/features/examples.md) + - [发布配置 Profile](toolchains/cargo/reference/profiles.md) + - [通过 config.toml 对 Cargo 进行配置](toolchains/cargo/reference/configuration.md) + - [发布到 crates.io](toolchains/cargo/reference/publishing-on-crates.io.md) + - [构建脚本 build.rs](toolchains/cargo/reference/build-script/intro.md) + - [构建脚本示例](toolchains/cargo/reference/build-script/examples.md) + +- [Rust 最佳实践](practice/intro.md) + - [对抗编译检查](practice/fight-with-compiler/intro.md) + - [生命周期](practice/fight-with-compiler/lifetime/intro.md) + - [生命周期过大-01](practice/fight-with-compiler/lifetime/too-long1.md) + - [生命周期过大-02](practice/fight-with-compiler/lifetime/too-long2.md) + - [循环中的生命周期](practice/fight-with-compiler/lifetime/loop.md) + - [闭包碰到特征对象-01](practice/fight-with-compiler/lifetime/closure-with-static.md) + - [重复借用](practice/fight-with-compiler/borrowing/intro.md) + - [同时在函数内外使用引用](practice/fight-with-compiler/borrowing/ref-exist-in-out-fn.md) + - [智能指针引起的重复借用错误](practice/fight-with-compiler/borrowing/borrow-distinct-fields-of-struct.md) + - [类型未限制(todo)](practice/fight-with-compiler/unconstrained.md) + - [幽灵数据(todo)](practice/fight-with-compiler/phantom-data.md) + - [Rust 常见陷阱](practice/pitfalls/index.md) + - [for 循环中使用外部数组](practice/pitfalls/use-vec-in-for.md) + - [线程类型导致的栈溢出](practice/pitfalls/stack-overflow.md) + - [算术溢出导致的 panic](practice/pitfalls/arithmetic-overflow.md) + - [闭包中奇怪的生命周期](practice/pitfalls/closure-with-lifetime.md) + - [可变变量不可变?](practice/pitfalls/the-disabled-mutability.md) + - [可变借用失败引发的深入思考](practice/pitfalls/multiple-mutable-references.md) + - [不太勤快的迭代器](practice/pitfalls/lazy-iterators.md) + - [奇怪的序列 x..y](practice/pitfalls/weird-ranges.md) + - [无处不在的迭代器](practice/pitfalls/iterator-everywhere.md) + - [线程间传递消息导致主线程无法结束](practice/pitfalls/main-with-channel-blocked.md) + - [警惕 UTF-8 引发的性能隐患](practice/pitfalls/utf8-performance.md) + - [日常开发三方库精选](practice/third-party-libs.md) + - [命名规范](practice/naming.md) + - [面试经验 doing](practice/interview.md) + - [代码开发实践 todo](practice/best-pratice.md) + - [日志记录 todo](practice/logs.md) + - [可观测性监控 todo](practice/observability.md) + +- [手把手带你实现链表](too-many-lists/intro.md) - [我们到底需不需要链表](too-many-lists/do-we-need-it.md) - [不太优秀的单向链表:栈](too-many-lists/bad-stack/intro.md) - [数据布局](too-many-lists/bad-stack/layout.md) @@ -172,48 +212,9 @@ - [Peek](too-many-lists/deque/peek.md) - [基本操作的对称镜像](too-many-lists/deque/symmetric.md) - [迭代器](too-many-lists/deque/iterator.md) -- [易混淆概念解析](confonding/intro.md) - - [切片和切片引用](confonding/slice.md) - - [Eq 和 PartialEq](confonding/eq.md) - - [String、&str 和 str todo](confonding/string.md) - - [原生指针、引用和智能指针 todo](confonding/pointer.md) - - [作用域、生命周期和 NLL todo](confonding/lifetime.md) - - [move、Copy 和 Clone todo](confonding/move-copy.md) + -- [对抗编译检查 doing](fight-with-compiler/intro.md) - - [幽灵数据(todo)](fight-with-compiler/phantom-data.md) - - [生命周期](fight-with-compiler/lifetime/intro.md) - - [生命周期过大-01](fight-with-compiler/lifetime/too-long1.md) - - [生命周期过大-02](fight-with-compiler/lifetime/too-long2.md) - - [循环中的生命周期](fight-with-compiler/lifetime/loop.md) - - [闭包碰到特征对象-01](fight-with-compiler/lifetime/closure-with-static.md) - - [重复借用](fight-with-compiler/borrowing/intro.md) - - [同时在函数内外使用引用](fight-with-compiler/borrowing/ref-exist-in-out-fn.md) - - [智能指针引起的重复借用错误](fight-with-compiler/borrowing/borrow-distinct-fields-of-struct.md) - - [类型未限制(todo)](fight-with-compiler/unconstrained.md) - -- [Rust 常见陷阱](pitfalls/index.md) - - [for 循环中使用外部数组](pitfalls/use-vec-in-for.md) - - [线程类型导致的栈溢出](pitfalls/stack-overflow.md) - - [算术溢出导致的 panic](pitfalls/arithmetic-overflow.md) - - [闭包中奇怪的生命周期](pitfalls/closure-with-lifetime.md) - - [可变变量不可变?](pitfalls/the-disabled-mutability.md) - - [可变借用失败引发的深入思考](pitfalls/multiple-mutable-references.md) - - [不太勤快的迭代器](pitfalls/lazy-iterators.md) - - [奇怪的序列 x..y](pitfalls/weird-ranges.md) - - [无处不在的迭代器](pitfalls/iterator-everywhere.md) - - [线程间传递消息导致主线程无法结束](pitfalls/main-with-channel-blocked.md) - - [警惕 UTF-8 引发的性能隐患](pitfalls/utf8-performance.md) - -- [Rust 最佳实践 doing](practice/intro.md) - - [日常开发三方库精选](practice/third-party-libs.md) - - [命名规范](practice/naming.md) - - [代码开发实践 todo](practice/best-pratice.md) - - [日志记录 todo](practice/logs.md) - - [可观测性监控 todo](practice/observability.md) - - [面试经验 doing](practice/interview.md) - -- [Rust 性能剖析 todo](profiling/intro.md) +- [Rust 性能优化 todo](profiling/intro.md) - [深入内存 todo](profiling/memory/intro.md) - [指针和引用 todo](profiling/memory/pointer-ref.md) - [未初始化内存 todo](profiling/memory/uninit.md) @@ -239,13 +240,14 @@ - [编译器优化 todo](profiling/compiler/optimization/intro.md) - [Option 枚举 todo](profiling/compiler/optimization/option.md) + - [标准库解析 todo](std/intro.md) - [标准库使用最佳时间 todo](std/search.md) - [Vector 常用方法 todo](std/vector.md) - [HashMap todo](std/hashmap.md) - [Iterator 常用方法 todo](std/iterator.md) -- [CookBook](cases/intro.md) +- [CookBook todo](cases/intro.md) - [命令行解析 todo](cases/cmd.md) - [配置文件解析 todo](cases/config.md) - [编解码 todo](cases/encoding/intro.md) diff --git a/src/confonding/cow.md b/src/advance/confonding/cow.md similarity index 100% rename from src/confonding/cow.md rename to src/advance/confonding/cow.md diff --git a/src/confonding/eq.md b/src/advance/confonding/eq.md similarity index 100% rename from src/confonding/eq.md rename to src/advance/confonding/eq.md diff --git a/src/confonding/intro.md b/src/advance/confonding/intro.md similarity index 100% rename from src/confonding/intro.md rename to src/advance/confonding/intro.md diff --git a/src/confonding/lifetime.md b/src/advance/confonding/lifetime.md similarity index 100% rename from src/confonding/lifetime.md rename to src/advance/confonding/lifetime.md diff --git a/src/confonding/move-copy.md b/src/advance/confonding/move-copy.md similarity index 100% rename from src/confonding/move-copy.md rename to src/advance/confonding/move-copy.md diff --git a/src/confonding/pointer.md b/src/advance/confonding/pointer.md similarity index 100% rename from src/confonding/pointer.md rename to src/advance/confonding/pointer.md diff --git a/src/confonding/slice.md b/src/advance/confonding/slice.md similarity index 100% rename from src/confonding/slice.md rename to src/advance/confonding/slice.md diff --git a/src/confonding/string.md b/src/advance/confonding/string.md similarity index 100% rename from src/confonding/string.md rename to src/advance/confonding/string.md diff --git a/src/async/async-await.md b/src/async-rust/async/async-await.md similarity index 100% rename from src/async/async-await.md rename to src/async-rust/async/async-await.md diff --git a/src/async/future-excuting.md b/src/async-rust/async/future-excuting.md similarity index 100% rename from src/async/future-excuting.md rename to src/async-rust/async/future-excuting.md diff --git a/src/async/getting-started.md b/src/async-rust/async/getting-started.md similarity index 100% rename from src/async/getting-started.md rename to src/async-rust/async/getting-started.md diff --git a/src/async-rust/async/intro.md b/src/async-rust/async/intro.md new file mode 100644 index 00000000..0b55ac86 --- /dev/null +++ b/src/async-rust/async/intro.md @@ -0,0 +1,5 @@ +# 异步编程 + +接下来,我们将深入了解 async/await 的使用方式及背后的原理。 + +> 本章在内容上大量借鉴和翻译了原版英文书籍[Asynchronous Programming In Rust](https://rust-lang.github.io/async-book/01_getting_started/01_chapter.html), 特此感谢 diff --git a/src/async/multi-futures-simultaneous.md b/src/async-rust/async/multi-futures-simultaneous.md similarity index 100% rename from src/async/multi-futures-simultaneous.md rename to src/async-rust/async/multi-futures-simultaneous.md diff --git a/src/async/pain-points-and-workarounds.md b/src/async-rust/async/pain-points-and-workarounds.md similarity index 100% rename from src/async/pain-points-and-workarounds.md rename to src/async-rust/async/pain-points-and-workarounds.md diff --git a/src/async/pin-unpin.md b/src/async-rust/async/pin-unpin.md similarity index 100% rename from src/async/pin-unpin.md rename to src/async-rust/async/pin-unpin.md diff --git a/src/async/web-server.md b/src/async-rust/async/web-server.md similarity index 100% rename from src/async/web-server.md rename to src/async-rust/async/web-server.md diff --git a/src/async/intro.md b/src/async-rust/intro.md similarity index 57% rename from src/async/intro.md rename to src/async-rust/intro.md index a888f990..416c5846 100644 --- a/src/async/intro.md +++ b/src/async-rust/intro.md @@ -1,6 +1,5 @@ -# 异步编程 - -在艰难的学完 Rust 入门和进阶所有的 55 个章节后,我们终于来到了这里。假如之前攀登的是珠穆拉玛峰,那么现在攀登的就是乔戈里峰( 比珠峰还难攀爬... ),本章将学习的内容是关于 async 异步编程。 +# Rust 异步编程 +在艰难的学完 Rust 入门和进阶所有的 70 个章节后,我们终于来到了这里。假如之前攀登的是珠穆拉玛峰,那么现在攀登的就是乔戈里峰( 比珠峰还难攀爬... )。 如果你想开发 Web 服务器、数据库驱动、消息服务等需要高并发的服务,那么本章的内容将值得认真对待和学习,将从以下方面深入讲解 Rust 的异步编程: @@ -9,6 +8,4 @@ - async/await 和 Pin/Unpin - 异步编程常用的三方库 - tokio 库 -- 一些示例 - -> 本章在内容上大量借鉴和翻译了原版英文书籍[Asynchronous Programming In Rust](https://rust-lang.github.io/async-book/01_getting_started/01_chapter.html), 特此感谢 +- 一些示例 \ No newline at end of file diff --git a/src/tokio/async.md b/src/async-rust/tokio/async.md similarity index 100% rename from src/tokio/async.md rename to src/async-rust/tokio/async.md diff --git a/src/tokio/bridging-with-sync.md b/src/async-rust/tokio/bridging-with-sync.md similarity index 100% rename from src/tokio/bridging-with-sync.md rename to src/async-rust/tokio/bridging-with-sync.md diff --git a/src/tokio/channels.md b/src/async-rust/tokio/channels.md similarity index 100% rename from src/tokio/channels.md rename to src/async-rust/tokio/channels.md diff --git a/src/tokio/frame.md b/src/async-rust/tokio/frame.md similarity index 100% rename from src/tokio/frame.md rename to src/async-rust/tokio/frame.md diff --git a/src/tokio/getting-startted.md b/src/async-rust/tokio/getting-startted.md similarity index 100% rename from src/tokio/getting-startted.md rename to src/async-rust/tokio/getting-startted.md diff --git a/src/tokio/graceful-shutdown.md b/src/async-rust/tokio/graceful-shutdown.md similarity index 100% rename from src/tokio/graceful-shutdown.md rename to src/async-rust/tokio/graceful-shutdown.md diff --git a/src/tokio/intro.md b/src/async-rust/tokio/intro.md similarity index 100% rename from src/tokio/intro.md rename to src/async-rust/tokio/intro.md diff --git a/src/tokio/io.md b/src/async-rust/tokio/io.md similarity index 100% rename from src/tokio/io.md rename to src/async-rust/tokio/io.md diff --git a/src/tokio/overview.md b/src/async-rust/tokio/overview.md similarity index 100% rename from src/tokio/overview.md rename to src/async-rust/tokio/overview.md diff --git a/src/tokio/select.md b/src/async-rust/tokio/select.md similarity index 100% rename from src/tokio/select.md rename to src/async-rust/tokio/select.md diff --git a/src/tokio/shared-state.md b/src/async-rust/tokio/shared-state.md similarity index 100% rename from src/tokio/shared-state.md rename to src/async-rust/tokio/shared-state.md diff --git a/src/tokio/spawning.md b/src/async-rust/tokio/spawning.md similarity index 100% rename from src/tokio/spawning.md rename to src/async-rust/tokio/spawning.md diff --git a/src/tokio/stream.md b/src/async-rust/tokio/stream.md similarity index 100% rename from src/tokio/stream.md rename to src/async-rust/tokio/stream.md diff --git a/src/errorindex/borrowing/intro.md b/src/errorindex/borrowing/intro.md deleted file mode 100644 index fcc4d744..00000000 --- a/src/errorindex/borrowing/intro.md +++ /dev/null @@ -1 +0,0 @@ -# 所有权和借用 diff --git a/src/errorindex/intro.md b/src/errorindex/intro.md deleted file mode 100644 index 7258196c..00000000 --- a/src/errorindex/intro.md +++ /dev/null @@ -1,3 +0,0 @@ -# 复杂错误索引 - -读者可以在本章中通过错误前缀来索引查询相应的解决方案,简单的错误并不在本章的内容范畴之内。 \ No newline at end of file diff --git a/src/errorindex/lifetime/intro.md b/src/errorindex/lifetime/intro.md deleted file mode 100644 index b859823e..00000000 --- a/src/errorindex/lifetime/intro.md +++ /dev/null @@ -1 +0,0 @@ -# 生命周期 todo diff --git a/src/fight-with-compiler/borrowing/borrow-distinct-fields-of-struct.md b/src/practice/fight-with-compiler/borrowing/borrow-distinct-fields-of-struct.md similarity index 100% rename from src/fight-with-compiler/borrowing/borrow-distinct-fields-of-struct.md rename to src/practice/fight-with-compiler/borrowing/borrow-distinct-fields-of-struct.md diff --git a/src/fight-with-compiler/borrowing/intro.md b/src/practice/fight-with-compiler/borrowing/intro.md similarity index 100% rename from src/fight-with-compiler/borrowing/intro.md rename to src/practice/fight-with-compiler/borrowing/intro.md diff --git a/src/fight-with-compiler/borrowing/ref-exist-in-out-fn.md b/src/practice/fight-with-compiler/borrowing/ref-exist-in-out-fn.md similarity index 100% rename from src/fight-with-compiler/borrowing/ref-exist-in-out-fn.md rename to src/practice/fight-with-compiler/borrowing/ref-exist-in-out-fn.md diff --git a/src/fight-with-compiler/intro.md b/src/practice/fight-with-compiler/intro.md similarity index 100% rename from src/fight-with-compiler/intro.md rename to src/practice/fight-with-compiler/intro.md diff --git a/src/fight-with-compiler/lifetime/closure-with-static.md b/src/practice/fight-with-compiler/lifetime/closure-with-static.md similarity index 100% rename from src/fight-with-compiler/lifetime/closure-with-static.md rename to src/practice/fight-with-compiler/lifetime/closure-with-static.md diff --git a/src/fight-with-compiler/lifetime/intro.md b/src/practice/fight-with-compiler/lifetime/intro.md similarity index 100% rename from src/fight-with-compiler/lifetime/intro.md rename to src/practice/fight-with-compiler/lifetime/intro.md diff --git a/src/fight-with-compiler/lifetime/loop.md b/src/practice/fight-with-compiler/lifetime/loop.md similarity index 100% rename from src/fight-with-compiler/lifetime/loop.md rename to src/practice/fight-with-compiler/lifetime/loop.md diff --git a/src/fight-with-compiler/lifetime/too-long1.md b/src/practice/fight-with-compiler/lifetime/too-long1.md similarity index 100% rename from src/fight-with-compiler/lifetime/too-long1.md rename to src/practice/fight-with-compiler/lifetime/too-long1.md diff --git a/src/fight-with-compiler/lifetime/too-long2.md b/src/practice/fight-with-compiler/lifetime/too-long2.md similarity index 100% rename from src/fight-with-compiler/lifetime/too-long2.md rename to src/practice/fight-with-compiler/lifetime/too-long2.md diff --git a/src/fight-with-compiler/phantom-data.md b/src/practice/fight-with-compiler/phantom-data.md similarity index 100% rename from src/fight-with-compiler/phantom-data.md rename to src/practice/fight-with-compiler/phantom-data.md diff --git a/src/fight-with-compiler/unconstrained.md b/src/practice/fight-with-compiler/unconstrained.md similarity index 100% rename from src/fight-with-compiler/unconstrained.md rename to src/practice/fight-with-compiler/unconstrained.md diff --git a/src/practice/intro.md b/src/practice/intro.md index 7f89d0ee..805221d7 100644 --- a/src/practice/intro.md +++ b/src/practice/intro.md @@ -1,2 +1,3 @@ # Rust最佳实践 + 对于生产级项目而言,运行稳定性和可维护性是非常重要的,本章就一起来看看 Rust 项目有哪些最佳实践准则。 \ No newline at end of file diff --git a/src/pitfalls/arithmetic-overflow.md b/src/practice/pitfalls/arithmetic-overflow.md similarity index 100% rename from src/pitfalls/arithmetic-overflow.md rename to src/practice/pitfalls/arithmetic-overflow.md diff --git a/src/pitfalls/closure-with-lifetime.md b/src/practice/pitfalls/closure-with-lifetime.md similarity index 100% rename from src/pitfalls/closure-with-lifetime.md rename to src/practice/pitfalls/closure-with-lifetime.md diff --git a/src/pitfalls/index.md b/src/practice/pitfalls/index.md similarity index 100% rename from src/pitfalls/index.md rename to src/practice/pitfalls/index.md diff --git a/src/pitfalls/iterator-everywhere.md b/src/practice/pitfalls/iterator-everywhere.md similarity index 100% rename from src/pitfalls/iterator-everywhere.md rename to src/practice/pitfalls/iterator-everywhere.md diff --git a/src/pitfalls/lazy-iterators.md b/src/practice/pitfalls/lazy-iterators.md similarity index 100% rename from src/pitfalls/lazy-iterators.md rename to src/practice/pitfalls/lazy-iterators.md diff --git a/src/pitfalls/main-with-channel-blocked.md b/src/practice/pitfalls/main-with-channel-blocked.md similarity index 100% rename from src/pitfalls/main-with-channel-blocked.md rename to src/practice/pitfalls/main-with-channel-blocked.md diff --git a/src/pitfalls/multiple-mutable-references.md b/src/practice/pitfalls/multiple-mutable-references.md similarity index 100% rename from src/pitfalls/multiple-mutable-references.md rename to src/practice/pitfalls/multiple-mutable-references.md diff --git a/src/pitfalls/stack-overflow.md b/src/practice/pitfalls/stack-overflow.md similarity index 100% rename from src/pitfalls/stack-overflow.md rename to src/practice/pitfalls/stack-overflow.md diff --git a/src/pitfalls/the-disabled-mutability.md b/src/practice/pitfalls/the-disabled-mutability.md similarity index 100% rename from src/pitfalls/the-disabled-mutability.md rename to src/practice/pitfalls/the-disabled-mutability.md diff --git a/src/pitfalls/use-vec-in-for.md b/src/practice/pitfalls/use-vec-in-for.md similarity index 100% rename from src/pitfalls/use-vec-in-for.md rename to src/practice/pitfalls/use-vec-in-for.md diff --git a/src/pitfalls/utf8-performance.md b/src/practice/pitfalls/utf8-performance.md similarity index 100% rename from src/pitfalls/utf8-performance.md rename to src/practice/pitfalls/utf8-performance.md diff --git a/src/pitfalls/weird-ranges.md b/src/practice/pitfalls/weird-ranges.md similarity index 100% rename from src/pitfalls/weird-ranges.md rename to src/practice/pitfalls/weird-ranges.md diff --git a/src/cargo/getting-started.md b/src/toolchains/cargo/getting-started.md similarity index 100% rename from src/cargo/getting-started.md rename to src/toolchains/cargo/getting-started.md diff --git a/src/cargo/git-auth.md b/src/toolchains/cargo/git-auth.md similarity index 100% rename from src/cargo/git-auth.md rename to src/toolchains/cargo/git-auth.md diff --git a/src/cargo/guide/build-cache.md b/src/toolchains/cargo/guide/build-cache.md similarity index 100% rename from src/cargo/guide/build-cache.md rename to src/toolchains/cargo/guide/build-cache.md diff --git a/src/cargo/guide/cargo-cache.md b/src/toolchains/cargo/guide/cargo-cache.md similarity index 100% rename from src/cargo/guide/cargo-cache.md rename to src/toolchains/cargo/guide/cargo-cache.md diff --git a/src/cargo/guide/cargo-toml-lock.md b/src/toolchains/cargo/guide/cargo-toml-lock.md similarity index 100% rename from src/cargo/guide/cargo-toml-lock.md rename to src/toolchains/cargo/guide/cargo-toml-lock.md diff --git a/src/cargo/guide/dependencies.md b/src/toolchains/cargo/guide/dependencies.md similarity index 100% rename from src/cargo/guide/dependencies.md rename to src/toolchains/cargo/guide/dependencies.md diff --git a/src/cargo/guide/download-package.md b/src/toolchains/cargo/guide/download-package.md similarity index 100% rename from src/cargo/guide/download-package.md rename to src/toolchains/cargo/guide/download-package.md diff --git a/src/cargo/guide/intro.md b/src/toolchains/cargo/guide/intro.md similarity index 100% rename from src/cargo/guide/intro.md rename to src/toolchains/cargo/guide/intro.md diff --git a/src/cargo/guide/package-layout.md b/src/toolchains/cargo/guide/package-layout.md similarity index 100% rename from src/cargo/guide/package-layout.md rename to src/toolchains/cargo/guide/package-layout.md diff --git a/src/cargo/guide/tests-ci.md b/src/toolchains/cargo/guide/tests-ci.md similarity index 100% rename from src/cargo/guide/tests-ci.md rename to src/toolchains/cargo/guide/tests-ci.md diff --git a/src/cargo/guide/why-exist.md b/src/toolchains/cargo/guide/why-exist.md similarity index 100% rename from src/cargo/guide/why-exist.md rename to src/toolchains/cargo/guide/why-exist.md diff --git a/src/cargo/intro.md b/src/toolchains/cargo/intro.md similarity index 100% rename from src/cargo/intro.md rename to src/toolchains/cargo/intro.md diff --git a/src/cargo/reference/build-script/examples.md b/src/toolchains/cargo/reference/build-script/examples.md similarity index 100% rename from src/cargo/reference/build-script/examples.md rename to src/toolchains/cargo/reference/build-script/examples.md diff --git a/src/cargo/reference/build-script/intro.md b/src/toolchains/cargo/reference/build-script/intro.md similarity index 100% rename from src/cargo/reference/build-script/intro.md rename to src/toolchains/cargo/reference/build-script/intro.md diff --git a/src/cargo/reference/cargo-target.md b/src/toolchains/cargo/reference/cargo-target.md similarity index 100% rename from src/cargo/reference/cargo-target.md rename to src/toolchains/cargo/reference/cargo-target.md diff --git a/src/cargo/reference/configuration.md b/src/toolchains/cargo/reference/configuration.md similarity index 100% rename from src/cargo/reference/configuration.md rename to src/toolchains/cargo/reference/configuration.md diff --git a/src/cargo/reference/deps-overriding.md b/src/toolchains/cargo/reference/deps-overriding.md similarity index 100% rename from src/cargo/reference/deps-overriding.md rename to src/toolchains/cargo/reference/deps-overriding.md diff --git a/src/cargo/reference/env.md b/src/toolchains/cargo/reference/env.md similarity index 100% rename from src/cargo/reference/env.md rename to src/toolchains/cargo/reference/env.md diff --git a/src/cargo/reference/features/examples.md b/src/toolchains/cargo/reference/features/examples.md similarity index 100% rename from src/cargo/reference/features/examples.md rename to src/toolchains/cargo/reference/features/examples.md diff --git a/src/cargo/reference/features/intro.md b/src/toolchains/cargo/reference/features/intro.md similarity index 100% rename from src/cargo/reference/features/intro.md rename to src/toolchains/cargo/reference/features/intro.md diff --git a/src/cargo/reference/intro.md b/src/toolchains/cargo/reference/intro.md similarity index 100% rename from src/cargo/reference/intro.md rename to src/toolchains/cargo/reference/intro.md diff --git a/src/cargo/reference/manifest.md b/src/toolchains/cargo/reference/manifest.md similarity index 100% rename from src/cargo/reference/manifest.md rename to src/toolchains/cargo/reference/manifest.md diff --git a/src/cargo/reference/package-id.md b/src/toolchains/cargo/reference/package-id.md similarity index 100% rename from src/cargo/reference/package-id.md rename to src/toolchains/cargo/reference/package-id.md diff --git a/src/cargo/reference/profile.md b/src/toolchains/cargo/reference/profile.md similarity index 100% rename from src/cargo/reference/profile.md rename to src/toolchains/cargo/reference/profile.md diff --git a/src/cargo/reference/profiles.md b/src/toolchains/cargo/reference/profiles.md similarity index 100% rename from src/cargo/reference/profiles.md rename to src/toolchains/cargo/reference/profiles.md diff --git a/src/cargo/reference/publishing-on-crates.io.md b/src/toolchains/cargo/reference/publishing-on-crates.io.md similarity index 100% rename from src/cargo/reference/publishing-on-crates.io.md rename to src/toolchains/cargo/reference/publishing-on-crates.io.md diff --git a/src/cargo/reference/specify-deps.md b/src/toolchains/cargo/reference/specify-deps.md similarity index 100% rename from src/cargo/reference/specify-deps.md rename to src/toolchains/cargo/reference/specify-deps.md diff --git a/src/cargo/reference/workspaces.md b/src/toolchains/cargo/reference/workspaces.md similarity index 100% rename from src/cargo/reference/workspaces.md rename to src/toolchains/cargo/reference/workspaces.md diff --git a/src/toolchains/intro.md b/src/toolchains/intro.md new file mode 100644 index 00000000..092c4695 --- /dev/null +++ b/src/toolchains/intro.md @@ -0,0 +1,5 @@ +# Rust 工具链指南 + +工具链是一门语言的第二灵魂,如果问一个 C++ 程序员,他最羡慕 Rust 什么,那答案很可能就是 Rust 的工具链。 + +而其中最主要的就是 Cargo 包管理工具,下面让我们从它开始。 \ No newline at end of file