Introduction
Variable lifetime tells us how long a variable stays usable in a program. It helps keep programs safe and free from errors.
When you want to make sure a reference does not outlive the data it points to.
When you pass references between functions and want to avoid mistakes.
When you want to understand why Rust sometimes asks for lifetime annotations.
When you want to prevent bugs related to using data that no longer exists.