String vs &str: Why Rust Has Two String Types (And What It Says About Memory)

When we first start learning Rust, we’ll hit this question almost immediately: why does Rust have both String and &str? Aren't they the…