Skip to content
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

Add a Lazy type as alternative to std::sync::Lazy #89

Merged
merged 2 commits into from
Oct 10, 2020

Conversation

phil-opp
Copy link
Contributor

The implementation is copied from the SyncLazy implementation in the standard library.

Resolves #88.

@zesterer
Copy link
Collaborator

Thanks very much for this!

@zesterer zesterer merged commit 770a57c into mvdnes:master Oct 10, 2020
@phil-opp phil-opp deleted the lazy branch October 10, 2020 16:27
@Ericson2314
Copy link
Contributor

I got a lot of déjà vu before I remembered rust-lang-nursery/lazy-static.rs@528ea62#diff-7b86b47fe3d41ce27a46ac8817b97d54 was in that crate not this one!

Seeing #88 I see putting one here is intention and FWIW I agree with that :). I guess someone just needs to go make lazy-static not implement it's own Lazy with or without spin_no_static.

@zesterer
Copy link
Collaborator

@Ericson2314 The difference with lazy_static's version seems to be that the function isn't a parameter on the type. That said, I don't see why they can't just use Once directly, it seems to have basically the same API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide alternatives for std::lazy::SyncLazy type?
3 participants