←back to thread

517 points bkolobara | 1 comments | | HN request time: 0.256s | source
Show context
dvt ◴[] No.45043355[source]
Using sync locks in an async environment is a code smell, so the Rust code is bad right off the bat. Just stick with async locks and take the tiny performance hit unless you know exactly what you're doing.
replies(2): >>45043377 #>>45052531 #
1. bkolobara ◴[] No.45052531[source]
I didn't need to hold the lock across the .await point and in that case the official docs recommend a regular lock.