You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have mut reference to a Mutex then get_mut method is more efficient than lock since it doesn't require locking. If clippy detects such situation it could suggest to use get_mut instead of lock.
The text was updated successfully, but these errors were encountered:
You need to use expr_ty instead of expr_ty_adjusted on the self argument of the lock call and check whether it's a mutable reference or a name of something that's mutable.
We can't detect whether we have immutable ownership to the value. so let foo = Mutex::new(...); foo.lock().... won't trigger :(
If you have
mut
reference to aMutex
thenget_mut
method is more efficient thanlock
since it doesn't require locking. If clippy detects such situation it could suggest to useget_mut
instead oflock
.The text was updated successfully, but these errors were encountered: