Toot

Written by nous@programming.dev on 2024-10-28 at 00:17

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

Mentions

=> View Giooschi@lemmy.world profile

Tags

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113382170451153810
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
223.207098 milliseconds
Gemini-to-HTML Time
0.477176 milliseconds

This content has been proxied by September (ba2dc).