Hacker News new | ask | show | jobs
by saghm 74 days ago
Yeah, the problem is that I usually think about stuff like this up front and then select something, and when much later I happen to change something, I focus so much on the types and the values that I forget that I need to also look at the keyword itself.

For what it's worth, my rule of thumb is usually to start with `static` and then only swap to `const` if I have a reason to. If I recall correctly, the issue I alluded to above was around picking between `LazyCell` and `LazyLock` and swapping between `&Path` and `PathBuf`, and some combination of them only working with `const` and not `static`.