Skip to content

Commit cd444ca

Browse files
committed
Flatten block in into_inner example.
1 parent f57de56 commit cd444ca

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

library/alloc/src/sync.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -609,20 +609,19 @@ impl<T> Arc<T> {
609609
/// // The following code could still cause a stack overflow
610610
/// // despite the manual `Drop` impl if that `Drop` impl used
611611
/// // `Arc::try_unwrap(arc).ok()` instead of `Arc::into_inner(arc)`.
612-
/// {
613-
/// // Create a long list and clone it
614-
/// let mut x = LinkedList::new();
615-
/// for i in 0..100000 {
616-
/// x.push(i); // Adds i to the front of x
617-
/// }
618-
/// let y = x.clone();
619612
///
620-
/// // Drop the clones in parallel
621-
/// let t1 = std::thread::spawn(|| drop(x));
622-
/// let t2 = std::thread::spawn(|| drop(y));
623-
/// t1.join().unwrap();
624-
/// t2.join().unwrap();
613+
/// // Create a long list and clone it
614+
/// let mut x = LinkedList::new();
615+
/// for i in 0..100000 {
616+
/// x.push(i); // Adds i to the front of x
625617
/// }
618+
/// let y = x.clone();
619+
///
620+
/// // Drop the clones in parallel
621+
/// let t1 = std::thread::spawn(|| drop(x));
622+
/// let t2 = std::thread::spawn(|| drop(y));
623+
/// t1.join().unwrap();
624+
/// t2.join().unwrap();
626625
/// ```
627626
628627
// FIXME: when `Arc::into_inner` is stabilized, adjust the documentation of

0 commit comments

Comments
 (0)