You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once is a low-level primitive and although correct not really the right tool for the job (anymore). Something like OnceLock::get_or_init provides the same functionality as Once + AtomicUsize/Bool in a much nicer API.
But I also think only allowing it to be set once is not necessarily the right thing either. I can imagine a program that might want to increase its limit if it encounters files that are too large iff the computer it's running on has spare resources.
Before it was using lazy_static. I've replaced it with Once to get rid of the extra dependency. OnceLock was not stable at the time but we can use it now!
I am not sure about the idea of making it editable at runtime. It will add extra complexity and no one really asked for it yet.
Activity
martin-g commentedon Aug 10, 2025
Before it was using
lazy_static. I've replaced it withOnceto get rid of the extra dependency. OnceLock was not stable at the time but we can use it now!I am not sure about the idea of making it editable at runtime. It will add extra complexity and no one really asked for it yet.
Kriskras99 commentedon Aug 10, 2025
I'll open a PR for this somewhere next week.