diff --git a/python-book/src/ch01-introduction-and-motivation.md b/python-book/src/ch01-introduction-and-motivation.md index f586f48..b9ab24c 100644 --- a/python-book/src/ch01-introduction-and-motivation.md +++ b/python-book/src/ch01-introduction-and-motivation.md @@ -404,6 +404,7 @@ graph LR PY_GIL --> PY_OS["OS / Hardware"] end + PY ~~~ RS subgraph RS["🦀 Rust"] direction TB RS_CODE["Your Code"] --> RS_NONE["No runtime overhead"] diff --git a/python-book/src/ch04-control-flow.md b/python-book/src/ch04-control-flow.md index 3988bc0..0c88084 100644 --- a/python-book/src/ch04-control-flow.md +++ b/python-book/src/ch04-control-flow.md @@ -218,6 +218,8 @@ flowchart LR P2 --> P4["result used later"] P3 --> P4 end + + Python ~~~ Rust subgraph Rust ["Rust — Expressions"] R1["let result = if cond"] --> R2["{ 'yes' }"] R1 --> R3["{ 'no' }"] diff --git a/python-book/src/ch05-data-structures-and-collections.md b/python-book/src/ch05-data-structures-and-collections.md index 7242470..4efc124 100644 --- a/python-book/src/ch05-data-structures-and-collections.md +++ b/python-book/src/ch05-data-structures-and-collections.md @@ -195,6 +195,7 @@ flowchart LR PH --> PHT["height: float obj"] PH --> PD["__dict__"] end + Python ~~~ Rust subgraph Rust ["Rust Struct (Stack)"] RW["width: f64
(8 bytes)"] --- RH["height: f64
(8 bytes)"] end diff --git a/python-book/src/ch10-traits-and-generics.md b/python-book/src/ch10-traits-and-generics.md index eb449fb..56a7dfe 100644 --- a/python-book/src/ch10-traits-and-generics.md +++ b/python-book/src/ch10-traits-and-generics.md @@ -322,6 +322,7 @@ flowchart TB VT --> I1["Article::summarize()"] VT --> I2["Tweet::summarize()"] end + Static ~~~ Dynamic style Static fill:#d4edda style Dynamic fill:#fff3cd ``` diff --git a/python-book/src/ch11-from-and-into-traits.md b/python-book/src/ch11-from-and-into-traits.md index 30e67e3..09f77a5 100644 --- a/python-book/src/ch11-from-and-into-traits.md +++ b/python-book/src/ch11-from-and-into-traits.md @@ -63,7 +63,7 @@ let n: i32 = "42".parse()?; // Propagate error with ? ### The From/Into Relationship ```mermaid -flowchart LR +flowchart TB A["impl From<A> for B"] -->|"auto-generates"| B["impl Into<B> for A"] C["Celsius::from(Fahrenheit(212.0))"] ---|"same as"| D["Fahrenheit(212.0).into()"] style A fill:#d4edda diff --git a/python-book/src/ch15-migration-patterns.md b/python-book/src/ch15-migration-patterns.md index a39d528..492e839 100644 --- a/python-book/src/ch15-migration-patterns.md +++ b/python-book/src/ch15-migration-patterns.md @@ -251,7 +251,7 @@ let db_host = get_config()["database"]["host"].as_str().unwrap(); ## Incremental Adoption Strategy ```mermaid -flowchart LR +flowchart TB A["1️⃣ Profile Python
(find hotspots)"] --> B["2️⃣ Write Rust Extension
(PyO3 + maturin)"] B --> C["3️⃣ Replace Python Call
(same API)"] C --> D["4️⃣ Expand Gradually
(more functions)"]