but imagine if you have to perform this operation for an unknown amount of runtime values
This is a poor argument. You dont write code like this in rust. If you can find a situation where it is an actual issue we can discuss things but to just say imagine this is a problem when it very likely is not a problem that can be solved in a better way at all let alone a common one is a very poor argument.
Typically when you want an escape from lifetimes that means you want shared ownership of data which you can do with an Arc. Cow and LazyLock can also help in situations - but to dismiss all these for some imagined problem is a waste of time. Comes up with a concrete example where it would help. Very likely you would find another way to solve the problem in any realistic situation you can come up with that I would suspect leads to a better overall design for a rust program.
=> More informations about this toot | View the thread | More toots from nous@programming.dev
=> View Giooschi@lemmy.world profile
text/gemini
This content has been proxied by September (ba2dc).