diff options
Diffstat (limited to 'src/docs/mutex_integer.txt')
| -rw-r--r-- | src/docs/mutex_integer.txt | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/docs/mutex_integer.txt b/src/docs/mutex_integer.txt deleted file mode 100644 index f9dbdfb904c..00000000000 --- a/src/docs/mutex_integer.txt +++ /dev/null @@ -1,22 +0,0 @@ -### What it does -Checks for usages of `Mutex<X>` where `X` is an integral -type. - -### Why is this bad? -Using a mutex just to make access to a plain integer -sequential is -shooting flies with cannons. `std::sync::atomic::AtomicUsize` is leaner and faster. - -### Known problems -This lint cannot detect if the mutex is actually used -for waiting before a critical section. - -### Example -``` -let x = Mutex::new(0usize); -``` - -Use instead: -``` -let x = AtomicUsize::new(0usize); -``` \ No newline at end of file |
