about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorBenoƮt C <benoit.cortier@fried-world.eu>2018-11-16 15:34:12 -0500
committerGitHub <noreply@github.com>2018-11-16 15:34:12 -0500
commitc1221e2072beebe90d6bbe8be99a51be1e6d11ea (patch)
tree7145f4319917f5614578a713798270715a2a7f5c /src/libstd/sync
parent6b9b97bd9b704f85f0184f7a213cc4d62bd9654c (diff)
downloadrust-c1221e2072beebe90d6bbe8be99a51be1e6d11ea.tar.gz
rust-c1221e2072beebe90d6bbe8be99a51be1e6d11ea.zip
Replace data.clone() by Arc::clone(&data) in mutex doc.
Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/mutex.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs
index 54bfd8122b4..ec9207ea45b 100644
--- a/src/libstd/sync/mutex.rs
+++ b/src/libstd/sync/mutex.rs
@@ -69,7 +69,7 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
 ///
 /// let (tx, rx) = channel();
 /// for _ in 0..N {
-///     let (data, tx) = (data.clone(), tx.clone());
+///     let (data, tx) = (Arc::clone(&data), tx.clone());
 ///     thread::spawn(move || {
 ///         // The shared state can only be accessed once the lock is held.
 ///         // Our non-atomic increment is safe because we're the only thread