Fix reported issues: hint mismatch, broken diagrams, chapter ordering

- async ch15: Fix exercise 4 hint to say Semaphore instead of mpsc
- python ch12: Fix broken Mermaid iterator chain diagram (quote edge labels)
- python ch14: Remove unnecessary escaped parens in Mermaid node label
- c-cpp ch16: Rename sub-chapter file so it sorts after parent in file listings
- c-cpp SUMMARY: Update sub-chapter title to reflect case studies 3-5
This commit is contained in:
Atul Khare
2026-04-11 09:19:00 -07:00
parent 75d79e9696
commit ce0354c4f6
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -196,7 +196,7 @@ async fn main() {
Implement an async-aware mutex using channels (without using `tokio::sync::Mutex`).
*Hint*: Use a `tokio::sync::mpsc` channel with capacity 1 as a semaphore.
*Hint*: Use a `tokio::sync::Semaphore` with 1 permit to serialize access.
<details>
<summary>🔑 Solution</summary>
+1 -1
View File
@@ -35,7 +35,7 @@
- [15. no_std — Rust Without the Standard Library](ch15-no_std-rust-without-the-standard-library.md)
- [Embedded Deep Dive](ch15-1-embedded-deep-dive.md)
- [16. Case Studies: Real-World C++ to Rust](ch16-case-studies.md)
- [Case Study — Lifetime Borrowing](ch16-1-case-study-lifetime-borrowing.md)
- [Case Studies 35: Lifetimes, Composability, Trait Objects](ch16-cases-3-5-lifetime-borrowing.md)
---
@@ -173,10 +173,10 @@ flat = [item for sublist in nested for item in sublist]
```mermaid
flowchart LR
A["Source<br/>[1,2,3,4,5]"] -->|.iter\(\)| B["Iterator"]
B -->|.filter\(\|x\| x%2==0\)| C["[2, 4]"]
C -->|.map\(\|x\| x*x\)| D["[4, 16]"]
D -->|.collect\(\)| E["Vec&lt;i32&gt;<br/>[4, 16]"]
A["Source<br/>[1,2,3,4,5]"] -->|".iter()"| B["Iterator"]
B -->|".filter(x: x%2==0)"| C["[2, 4]"]
C -->|".map(x: x*x)"| D["[4, 16]"]
D -->|".collect()"| E["Vec&lt;i32&gt;<br/>[4, 16]"]
style A fill:#ffeeba
style E fill:#d4edda
```
+1 -1
View File
@@ -13,7 +13,7 @@ Python never gives you direct memory access.
flowchart TB
subgraph Safe ["Safe Rust (99% of code)"]
S1["Your application logic"]
S2["pub fn safe_api\(&self\) -> Result"]
S2["pub fn safe_api(&self) -> Result"]
end
subgraph Unsafe ["unsafe block (minimal, audited)"]
U1["Raw pointer dereference"]