Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, but it's more than that.

once_cell allows you more ways to do lazy initialization.

Like by using `once_cell::sync::OnceCell` instead of `once_cell::sync::Lazy` you can determine the init function when trying to access the once cell. For many cases `Lazy` is what you want but for some `OnceCell` makes it just so much easier.

And then you also can use the types outside of a "lazy initialized static/global" use case.

So generally it's better (by now).






Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: