Federico Mena Quintero is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Federico Mena Quintero @federicomena

Today, two lifetime problems and I came out... alive.

Wrapping a temporary C array-of-strings, with CStr, HashMap, hash_map::Iter... and all those want their lifetimes.

· Web · 0 · 0

@federicomena I usually avoid them by either cloning, or using Arc/Rc instead. It's slightly more expensive but I rarely write performance critical code.

Maybe I 'll get how to use them properly given more time.

Rust tends to be fast enough that you can get away with stuff like that.

@federicomena ugh... upgrading to tokio has me seeing lifetimes on everything.... and everyone...

@juanlibres it scares me that I can't always get myself out of those errors. Getting better, I suppose.

@federicomena I collapse to the floor like and start to get up each time.... question is, how will my lifetime be referenced and how far off is the end of its scope?