The rules, stated plainly
- Each value has one owner.
- Only one owner at a time.
- When owner goes out of scope, value is dropped.
&str is a string slice (borrowed view). String owns heap data. Prefer &str in function args when you don't need ownership.
Quirk: Lifetimes ('a) tell the compiler how long references are valid. You'll meet them soon. They're friendlier than reputation suggests. Slightly.
Output
Press Run to execute your code.