Move to Arc::clone(&x) over x.clone() in library/core
This commit is contained in:
parent
81e85ce76d
commit
6b75e3d11b
2 changed files with 2 additions and 2 deletions
|
@ -541,7 +541,7 @@ impl<P: Deref> Pin<P> {
|
|||
/// use std::pin::Pin;
|
||||
///
|
||||
/// fn move_pinned_rc<T>(mut x: Rc<T>) {
|
||||
/// let pinned = unsafe { Pin::new_unchecked(x.clone()) };
|
||||
/// let pinned = unsafe { Pin::new_unchecked(Rc::clone(&x)) };
|
||||
/// {
|
||||
/// let p: Pin<&T> = pinned.as_ref();
|
||||
/// // This should mean the pointee can never move again.
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
//! fn main() {
|
||||
//! let spinlock = Arc::new(AtomicUsize::new(1));
|
||||
//!
|
||||
//! let spinlock_clone = spinlock.clone();
|
||||
//! let spinlock_clone = Arc::clone(&spinlock);
|
||||
//! let thread = thread::spawn(move|| {
|
||||
//! spinlock_clone.store(0, Ordering::SeqCst);
|
||||
//! });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue