Good morning.

Remember kids, if you have a MutexGuard, you have to drop that shit before doing async things so you're not trying to lock the Mutex during the async call. But don't use the function 'drop()'. Use curly braces to make a scope. Within that scope, clone that bitch out of there into a variable outside the scope then do async shit.

#rust #devstr

Reply to this note

Please Login to reply.

Discussion

Thanks this note literally prevented me from doing thisπŸ˜‚

🫑🀝

Whatcha working on?

If you're just cloning it, why use a mutex at all? Might as well do a copy for each thread πŸ˜…

Gm