Skip to content

Commit 60c8858

Browse files
Merge pull request #53 from stolenzc/main
Update chapter titles and numbering in the Rust Patterns
2 parents 5d669ad + 54bbe1f commit 60c8858

10 files changed

Lines changed: 31 additions & 27 deletions

rust-patterns-book/src/ch00-introduction.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ Each chapter is tagged with a difficulty level:
4949
| 5. Channels 🟢 | `mpsc`, crossbeam, `select!`, actors | 1–2 hours | Can implement a channel-based worker pool |
5050
| 6. Concurrency 🟡 | Threads, rayon, Mutex, RwLock, atomics | 2–3 hours | Can pick the right sync primitive for a scenario |
5151
| 7. Closures 🟢 | `Fn`/`FnMut`/`FnOnce`, combinators | 1–2 hours | Can write a higher-order function that accepts closures |
52-
| 8. Smart Pointers 🟡 | Box, Rc, Arc, RefCell, Cow, Pin | 2–3 hours | Can explain when to use each smart pointer |
52+
| 8. Functional vs. Imperative 🟡 | Combinators, iterator adapters, functional patterns | 2–3 hours | Can explain when functional style beats imperative |
53+
| 9. Smart Pointers 🟡 | Box, Rc, Arc, RefCell, Cow, Pin | 2–3 hours | Can explain when to use each smart pointer |
5354
| **Part III: Systems & Production** | | | |
54-
| 9. Error Handling 🟢 | thiserror, anyhow, `?` operator | 1–2 hours | Can design an error type hierarchy |
55-
| 10. Serialization 🟡 | serde, zero-copy, binary data | 2–3 hours | Can write a custom serde deserializer |
56-
| 11. Unsafe 🔴 | Superpowers, FFI, UB pitfalls, allocators | 2–3 hours | Can wrap unsafe code in a sound safe API |
57-
| 12. Macros 🟡 | `macro_rules!`, proc macros, `syn`/`quote` | 2–3 hours | Can write a declarative macro with `tt` munching |
58-
| 13. Testing 🟢 | Unit/integration/doc tests, proptest, criterion | 1–2 hours | Can set up property-based tests |
59-
| 14. API Design 🟡 | Module layout, ergonomic APIs, feature flags | 2–3 hours | Can apply the "parse, don't validate" pattern |
60-
| 15. Async 🔴 | Futures, Tokio, common pitfalls | 1–2 hours | Can identify async anti-patterns |
55+
| 10. Error Handling 🟢 | thiserror, anyhow, `?` operator | 1–2 hours | Can design an error type hierarchy |
56+
| 11. Serialization 🟡 | serde, zero-copy, binary data | 2–3 hours | Can write a custom serde deserializer |
57+
| 12. Unsafe 🔴 | Superpowers, FFI, UB pitfalls, allocators | 2–3 hours | Can wrap unsafe code in a sound safe API |
58+
| 13. Macros 🟡 | `macro_rules!`, proc macros, `syn`/`quote` | 2–3 hours | Can write a declarative macro with `tt` munching |
59+
| 14. Testing 🟢 | Unit/integration/doc tests, proptest, criterion | 1–2 hours | Can set up property-based tests |
60+
| 15. API Design 🟡 | Module layout, ergonomic APIs, feature flags | 2–3 hours | Can apply the "parse, don't validate" pattern |
61+
| 16. Async 🔴 | Futures, Tokio, common pitfalls | 1–2 hours | Can identify async anti-patterns |
6162
| **Appendices** | | | |
6263
| Reference Card | Quick-look trait bounds, lifetimes, patterns | As needed ||
6364
| Capstone Project | Type-safe task scheduler | 4–6 hours | Submit a working implementation |
@@ -102,38 +103,41 @@ OS threads, scoped threads, rayon, Mutex/RwLock/Atomics, Condvar, OnceLock, lock
102103
**[7. Closures and Higher-Order Functions](ch07-closures-and-higher-order-functions.md)** 🟢
103104
`Fn`/`FnMut`/`FnOnce`, closures as parameters/return values, combinators, higher-order APIs.
104105

105-
**[8. Smart Pointers and Interior Mutability](ch08-smart-pointers-and-interior-mutability.md)** 🟡
106+
**[8. Functional vs. Imperative: When Elegance Wins (and When It Doesn't)](ch08-functional-vs-imperative-when-elegance-wins.md)** 🟡
107+
Combinators, iterator adapters, functional patterns.
108+
109+
**[9. Smart Pointers and Interior Mutability](ch09-smart-pointers-and-interior-mutability.md)** 🟡
106110
Box, Rc, Arc, Weak, Cell/RefCell, Cow, Pin, ManuallyDrop.
107111

108112
### Part III: Systems & Production
109113

110-
**[9. Error Handling Patterns](ch09-error-handling-patterns.md)** 🟢
114+
**[10. Error Handling Patterns](ch10-error-handling-patterns.md)** 🟢
111115
thiserror vs anyhow, `#[from]`, `.context()`, `?` operator, panics.
112116

113-
**[10. Serialization, Zero-Copy, and Binary Data](ch10-serialization-zero-copy-and-binary-data.md)** 🟡
117+
**[11. Serialization, Zero-Copy, and Binary Data](ch11-serialization-zero-copy-and-binary-data.md)** 🟡
114118
serde fundamentals, enum representations, zero-copy deserialization, `repr(C)`, `bytes::Bytes`.
115119

116-
**[11. Unsafe Rust — Controlled Danger](ch11-unsafe-rust-controlled-danger.md)** 🔴
120+
**[12. Unsafe Rust — Controlled Danger](ch12-unsafe-rust-controlled-danger.md)** 🔴
117121
Five superpowers, sound abstractions, FFI, UB pitfalls, arena/slab allocators.
118122

119-
**[12. Macros — Code That Writes Code](ch12-macros-code-that-writes-code.md)** 🟡
123+
**[13. Macros — Code That Writes Code](ch13-macros-code-that-writes-code.md)** 🟡
120124
`macro_rules!`, when (not) to use macros, proc macros, derive macros, `syn`/`quote`.
121125

122-
**[13. Testing and Benchmarking Patterns](ch13-testing-and-benchmarking-patterns.md)** 🟢
126+
**[14. Testing and Benchmarking Patterns](ch14-testing-and-benchmarking-patterns.md)** 🟢
123127
Unit/integration/doc tests, proptest, criterion, mocking strategies.
124128

125-
**[14. Crate Architecture and API Design](ch14-crate-architecture-and-api-design.md)** 🟡
129+
**[15. Crate Architecture and API Design](ch15-crate-architecture-and-api-design.md)** 🟡
126130
Module layout, API design checklist, ergonomic parameters, feature flags, workspaces.
127131

128-
**[15. Async/Await Essentials](ch15-asyncawait-essentials.md)** 🔴
132+
**[16. Async/Await Essentials](ch16-asyncawait-essentials.md)** 🔴
129133
Futures, Tokio quick-start, common pitfalls. (For deep async coverage, see our Async Rust Training.)
130134

131135
### Appendices
132136

133-
**[Summary and Reference Card](ch17-summary-and-reference-card.md)**
137+
**[Summary and Reference Card](ch18-summary-and-reference-card.md)**
134138
Pattern decision guide, trait bounds cheat sheet, lifetime elision rules, further reading.
135139

136-
**[Capstone Project: Type-Safe Task Scheduler](ch18-capstone-project.md)**
140+
**[Capstone Project: Type-Safe Task Scheduler](ch19-capstone-project.md)**
137141
Integrate generics, traits, typestate, channels, error handling, and testing into a complete system.
138142

139143
***

rust-patterns-book/src/ch08-functional-vs-imperative-when-elegance-wins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Chapter 8 — Functional vs. Imperative: When Elegance Wins (and When It Doesn't)
1+
# 8. Functional vs. Imperative: When Elegance Wins (and When It Doesn't)
22

33
> **Difficulty:** 🟡 Intermediate | **Time:** 2–3 hours | **Prerequisites:** [Ch 7 — Closures](ch07-closures-and-higher-order-functions.md)
44

rust-patterns-book/src/ch09-smart-pointers-and-interior-mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 8. Smart Pointers and Interior Mutability 🟡
1+
# 9. Smart Pointers and Interior Mutability 🟡
22

33
> **What you'll learn:**
44
> - Box, Rc, Arc for heap allocation and shared ownership

rust-patterns-book/src/ch10-error-handling-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 9. Error Handling Patterns 🟢
1+
# 10. Error Handling Patterns 🟢
22

33
> **What you'll learn:**
44
> - When to use `thiserror` (libraries) vs `anyhow` (applications)

rust-patterns-book/src/ch11-serialization-zero-copy-and-binary-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 10. Serialization, Zero-Copy, and Binary Data 🟡
1+
# 11. Serialization, Zero-Copy, and Binary Data 🟡
22

33
> **What you'll learn:**
44
> - serde fundamentals: derive macros, attributes, and enum representations

rust-patterns-book/src/ch12-unsafe-rust-controlled-danger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 11. Unsafe Rust — Controlled Danger 🔴
1+
# 12. Unsafe Rust — Controlled Danger 🔴
22

33
> **What you'll learn:**
44
> - The five unsafe superpowers and when each is needed

rust-patterns-book/src/ch13-macros-code-that-writes-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 12. Macros — Code That Writes Code 🟡
1+
# 13. Macros — Code That Writes Code 🟡
22

33
> **What you'll learn:**
44
> - Declarative macros (`macro_rules!`) with pattern matching and repetition

rust-patterns-book/src/ch14-testing-and-benchmarking-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 13. Testing and Benchmarking Patterns 🟢
1+
# 14. Testing and Benchmarking Patterns 🟢
22

33
> **What you'll learn:**
44
> - Rust's three test tiers: unit, integration, and doc tests

rust-patterns-book/src/ch15-crate-architecture-and-api-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 14. Crate Architecture and API Design 🟡
1+
# 15. Crate Architecture and API Design 🟡
22

33
> **What you'll learn:**
44
> - Module layout conventions and re-export strategies

rust-patterns-book/src/ch16-asyncawait-essentials.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 15. Async/Await Essentials 🔴
1+
# 16. Async/Await Essentials 🔴
22

33
> **What you'll learn:**
44
> - How Rust's `Future` trait differs from Go's goroutines and Python's asyncio

0 commit comments

Comments
 (0)