-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from lazy_static to once_cell #65
Comments
I prefer once_cell. I actually started with it. However it pulls in a huge number of transitive dependencies (or at least it did when I last checked), and I would like to keep aHash as light as possible given how low level it is. |
Just checked, |
I think the trouble is that aHash would need parking_lot. Per the doc:
Which is sort of a shame, because the whole reason for the need for the lock is to block to make sure the initialization code doesn't get run multiple times. However I don't actually care about that. If there were an "ApproximatelyOnceCell" with zero deps that would be ideal. |
I don't exactly understand. Is it that you wouldn't want to use |
I don't care about the 16 bytes. I care about pulling in a dependency on parking_lot. If I can avoid having all those deps and get a working solution I'd be happy. I created matklad/once_cell#133 to track the issue. Either of matklad/once_cell#61 or matklad/once_cell#53 would also be acceptable. |
Oh, so the issue is |
Ok. c828cc6 |
once_cell::sync::Lazy fulfills the same task as
lazy_static
but is less magic in that it doesn't require a macro. A lot of crates have switched already and std has adopted large parts ofonce_cell
s API surface as a Nightly feature (tracking issue). Would you be open to a PR that switches aHash over too?The text was updated successfully, but these errors were encountered: