Avatar

Barbacamanitu

Barbacamanitu@lemmy.world
Joined
3 posts • 110 comments
Direct message

I deleted my 14 year old reddit account when they pulled their shit. Then I recently created a new account because I need to be able to get answers to specific programming questions sometimes, and lemmy doesn’t have the population of users that reddit still has. I generally post on both lemmy and reddit, but I almost always get more answers on reddit.

permalink
report
reply

If you gave him an enema he could be buried in a matchbox.

That’s what Christopher Hitchens said about Jerry Falwell when he died. It applies equally to trump.

permalink
report
parent
reply

Ah I didn’t realize most people have moved onto OnceCell. The issue with both lazy static and oncecell is that they can only be assigned to once. You need a global mutable state, so neither OnceCell or lazy_static are the right choice.

You’re going to be fighting the borrow checker if you try to have global mutable state. It will bite you eventually. You can potentially use an interior mutablity pattern along with a mutex. Have you looked into interior mutability?

permalink
report
parent
reply

Very cool. I’ll have to try it out. I just started using React, and I’m beginning to love it. React with rust sounds like heaven.

permalink
report
parent
reply

Maybe lazy_static? Personally I’d just pass a borrow to the vec around. It’s very common for programs to have some global state that they pass around to different parts.

permalink
report
reply

Woah. First I’ve heard of dioxus. Has anyone here tried it?

permalink
report
reply

Lol not a great name choice. Wish I would have thought of it though.

permalink
report
parent
reply