3 ms·
The return type might be inferred, but you're definitely supposed to remember locks. Nothing in the language will prevent you from accessing a protected resourc
by candiodari 4y ago
The return type might be inferred, but you're definitely supposed to remember locks. Nothing in the language will prevent you from accessing a protected resource without locking the lock.
In Rust that can be made impossible.
- gabereiser 4y agoMaking a locking thread safe slice or map is as easy at creating a struct with two fields and three member functions… then you can access it and it will lock itself and unlock itself.