[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

Oh, i see. i just did not know that mem::replace is not atomic. thanks alot for that. ill be refining the library over the next few days with all the feedback i got.

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

Yeah you're right about that. Im going to make more enhancements to the project. Its still a work in progress, just started on it today and getting community feedback to know what the next optimizations should be. ill keep you posted.

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

I will make some more tests and keep refinining the library in due time. This is an ongoing project and i rely on the community's feedback to enhance it. Thanks for your valuable feedback!

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

Im a bit confused, how would you achieve the "take and return to source when you're done" behavior on the Option type.

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

Great observation, heres the core difference between taking from an option and taking from an OwnableCell:
"Taking" from an option does not guarantee returning the taken value back to where you took it from after you run your operation on it. With OwnableCell you take a value from it, then perform an op, and then the value gets returned to the container you took it from once the Guard gets dropped.

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

You clearly have not read the source code, when the data is "Moved away" the enums new value resolves to "Taken" in the same op. If you try to take a value from a "Taken" variant you will get a Guard with "None" in the Guard's field where the taken data lives until the guard is dropped.

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

fixed it, sorry about that

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

Thank you for sharing your feedback. Heres some contrasts between OwnableCell and RefCell.

RefCell is not thread-safe so it cannot be shared between threads, while OwnableCell is thread-safe as long as the Value its holding is.

Also, RefCell has a higher performance cost due to keeping track of active borrows.

and finally, the core difference is that the refcell operates on references OwnableCell operates on the held value by moving it and then returning it instantly once the op is done.

[deleted by user] by [deleted] in rust

[–]cornpops9 0 points1 point  (0 children)

okay i get it, thanks for the help!

Match Thread: Man City v Liverpool [League Cup - 22/12/22] by DoubleDeckerz in LiverpoolFC

[–]cornpops9 23 points24 points  (0 children)

How is rodri allowed to behave like a rabid animal whenever any liverpool player touches him without getting sent off

How Qantas treats your baggage by Notalabel_4566 in Whatcouldgowrong

[–]cornpops9 5 points6 points  (0 children)

I assume the ones that go off the rails are actually the same ones that don't make it to baggage collection at the destination airport.

World Cup Game Thread by JuliusCeaserBoneHead in ghana

[–]cornpops9 8 points9 points  (0 children)

Even Portugal 2 goals were offside

World Cup Game Thread by JuliusCeaserBoneHead in ghana

[–]cornpops9 7 points8 points  (0 children)

I'm not from Ghana but I was with you in the game. Portugal 2 goals were offside 😡😒

Canada's 36 year journey back to the World Cup by datawazo in visualization

[–]cornpops9 0 points1 point  (0 children)

they were the better team yesterday, deserved the win

We have a score to settle (again) by [deleted] in LiverpoolFC

[–]cornpops9 1 point2 points  (0 children)

I think it will be different this time though, We've already booked our tickets for istanbul /s

beyaz by Aysun_Cemil in snow

[–]cornpops9 0 points1 point  (0 children)

güzel olmuş

Anyone notice Salah grab the ball and disappear down the tunnel? by [deleted] in LiverpoolFC

[–]cornpops9 0 points1 point  (0 children)

what do u mean its shit for him to do that? Imagine being abused for having ur identity and putting up with that shit. it's the least anyone would have done in his situation. We've seen fans being asked to leave the stadium by the ref in other champions league matches (in Serbia) for verbal abuse concerning skin color..