mirror of
https://github.com/facebook/sapling.git
synced 2024-10-13 02:07:31 +03:00
6c6d948385
Summary: I find that it is common pattern ``` // create unnecessary to reduce scope of lock guard let output = { let mut value = mutex_value.lock().expect("lock poisoned"); ... // do some stuff here }; ``` This extension simplifies this pattern to ``` let output = mutex_value.with(|value| /* do some stuff here */); ``` Reviewed By: Imxset21, farnz Differential Revision: D15577135 fbshipit-source-id: 6b22b20dda79e532ff5ec8ce75cda8b1c1404368 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |