-
Notifications
You must be signed in to change notification settings - Fork 109
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
Lazy
mutable API extension
#193
Conversation
It do not really makes sense to add this API to |
This basically looks good to me! Thigs left to do:
|
oups, missed this Q, sorry. No, I think it does make sense to have this for sync as well, the same as |
Cool, will take a look at how |
f3b9cf8
to
eef42a7
Compare
@matklad I added same mut API for |
unsync::Lazy
APIOnceCell
and Lazy
mutable API extension
I feel that in the latest iteration it maybe scope-crept to far. I don't think we need to extend |
@matkad, you mean all the implementations or just the |
I think we only need to add these four APIs
And |
Not to discuss here probably. But having the option to get the let cell = OnceCell::new();
cell.get_or_init(|| String::new("foo"));
let mut mut_ref = cell.get_mut().unwrap(); and instead keep the api as expected: let cell = OnceCell::new();
let mut mut_ref = cell.get_mut_or_init(|| String::new("foo")); It seems not too much, but bump into that already in the past (and today once again 😅 ). |
@matklad , I left just the |
OnceCell
and Lazy
mutable API extensionLazy
mutable API extension
bors r+ Thanks! |
Hi,
don’t really know how my email got onto this distribution list :-) being a programmer myself, I keep fingers crossed for the success of your project.
Let me know when it’s done, but please I don’t need to see all the small updates :D
Cheers,
Mateusz
… On 2 Sep 2022, at 13:48, Aleksey Kladov ***@***.***> wrote:
bors r+
Thanks!
—
Reply to this email directly, view it on GitHub <#193 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGDPX3GK7EAYFCJO5QVTM3TV4HSQ5ANCNFSM6AAAAAAQCFKW6M>.
You are receiving this because you were mentioned.
|
Build succeeded: |
matkad sorry, I think that was a typo in a mention due to our github logins having a hamming distance of one: https://github.com/matkad vs https://github.com/matklad |
As requested in #113. Also added explicit
get_mut
.Implement:
async::Lazy::force_mut
async::Lazy::get_mut
sync::Lazy::force_mut
sync::Lazy::get_mut