Rollup merge of #56011 - CBenoit:master, r=QuietMisdreavus

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.
Since this clone is visible in the official documentation, I thought it could be better to use the more idiomatic version.
This commit is contained in:
Pietro Albini 2018-11-18 23:24:56 +01:00 committed by kennytm
commit 05ae505a4c
No known key found for this signature in database
GPG Key ID: FEF6C8051D0E013C

View File

@ -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