Skip to content

Commit

Permalink
Move to Arc::clone(&x) over x.clone() in library/core
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics committed Aug 30, 2020
1 parent 81e85ce commit 6b75e3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/core/src/pin.rs
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/sync/atomic.rs
Expand Up @@ -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);
//! });
Expand Down

0 comments on commit 6b75e3d

Please sign in to comment.