DEV Community

Discussion on: The Borrow Checker and Memory Management

Collapse
 
oh_god_it_works profile image
mawOfMalfunctions

The one thing I never seem to get into my head are lifetime parameters. The syntax is just so strange and it seems hard to find examples for specific cases anywhere. It feels like fighting the borrow checker but without even knowing what it wants.

Collapse
 
strottos profile image
Steven Trotter

Agreed, lifetimes are more difficult and I figured perhaps warrants an article in itself. I certainly haven't tried to cover them here, would have been too much. In principal they're not so bad but in practice can be a different experience, I still struggle at times and have been known to use other techniques in order to avoid having to (which is clearly not the right way of doing things).

I'll try and put together a lifetimes article at some point as well. I'd be curious to have an example of the kind of thing you do struggle with if you'd be so kind/have one to hand.