‘a like a type signature but instead of tracking the type of data it tracks the lifetime. Usually it's good to be explicit with these when writing functions and data types that access references, otherwise you can run into confusing borrow checker error messages.

Reply to this note

Please Login to reply.

Discussion

I built a entire app in rust without needing to use (manually define) lifetimes. I suspect it’s one of rust’s parts that can be learned later (when you need to use it).

Don’t worry. You’ll hate rust until you love it. Get ChatGPT to explain and illustrate by writing code snippets for you.

you don’t need to worry about it if you’re not thinking about the performance of your code. You can usually .clone() things without thinking of what is actually happening under the hood (slow stuff)

That’s true. When you’re learning, you just clone everything. 😀