Stack Memory
Creating a String puts fixed-sized data on the stack and dynamically sized
data on the heap:
fn main() { let s1 = String::from("Hello"); }
- Mention that a
Stringis backed by aVec, so it has a capacity and length and can grow if mutable via reallocation on the heap.