diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-08-30 21:59:43 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-08-30 21:59:43 +0200 |
| commit | 81e85ce76d6630a8f87f81df2470e76fbe73de7d (patch) | |
| tree | 55988a948bd8b9f80aba09c8a6e9ef8d13eaf6e1 /library/std/src/sync/mutex.rs | |
| parent | 85fbf49ce0e2274d0acf798f6e703747674feec3 (diff) | |
| download | rust-81e85ce76d6630a8f87f81df2470e76fbe73de7d.tar.gz rust-81e85ce76d6630a8f87f81df2470e76fbe73de7d.zip | |
Move to Arc::clone(&x) over x.clone() in library/std
Diffstat (limited to 'library/std/src/sync/mutex.rs')
| -rw-r--r-- | library/std/src/sync/mutex.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/sync/mutex.rs b/library/std/src/sync/mutex.rs index d7a4f00305c..39a5a455fe4 100644 --- a/library/std/src/sync/mutex.rs +++ b/library/std/src/sync/mutex.rs @@ -85,7 +85,7 @@ use crate::sys_common::poison::{self, LockResult, TryLockError, TryLockResult}; /// use std::thread; /// /// let lock = Arc::new(Mutex::new(0_u32)); -/// let lock2 = lock.clone(); +/// let lock2 = Arc::clone(&lock); /// /// let _ = thread::spawn(move || -> () { /// // This thread will acquire the mutex first, unwrapping the result of @@ -256,7 +256,7 @@ impl<T: ?Sized> Mutex<T> { /// use std::thread; /// /// let mutex = Arc::new(Mutex::new(0)); - /// let c_mutex = mutex.clone(); + /// let c_mutex = Arc::clone(&mutex); /// /// thread::spawn(move || { /// *c_mutex.lock().unwrap() = 10; @@ -292,7 +292,7 @@ impl<T: ?Sized> Mutex<T> { /// use std::thread; /// /// let mutex = Arc::new(Mutex::new(0)); - /// let c_mutex = mutex.clone(); + /// let c_mutex = Arc::clone(&mutex); /// /// thread::spawn(move || { /// let mut lock = c_mutex.try_lock(); @@ -328,7 +328,7 @@ impl<T: ?Sized> Mutex<T> { /// use std::thread; /// /// let mutex = Arc::new(Mutex::new(0)); - /// let c_mutex = mutex.clone(); + /// let c_mutex = Arc::clone(&mutex); /// /// let _ = thread::spawn(move || { /// let _lock = c_mutex.lock().unwrap(); |
