about summary refs log tree commit diff
path: root/src/liballoc/arc.rs
diff options
context:
space:
mode:
authorSrinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>2016-05-28 02:25:16 +0530
committerSrinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>2016-05-28 02:25:16 +0530
commit3fd0e4c7f2eafa4382ff33a3274cec03e8b207f2 (patch)
treeb1e49d44350cc71af150d272b6e04159f1e9a5e7 /src/liballoc/arc.rs
parentab7c35fa0fcd725cdc207487b760d85fd07ecdd7 (diff)
downloadrust-3fd0e4c7f2eafa4382ff33a3274cec03e8b207f2.tar.gz
rust-3fd0e4c7f2eafa4382ff33a3274cec03e8b207f2.zip
rustfmt liballoc folder
Diffstat (limited to 'src/liballoc/arc.rs')
-rw-r--r--src/liballoc/arc.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index d0a51e320cc..729d9218a29 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -72,7 +72,7 @@
 use boxed::Box;
 
 use core::sync::atomic;
-use core::sync::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
+use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
 use core::borrow;
 use core::fmt;
 use core::cmp::Ordering;
@@ -85,7 +85,7 @@ use core::ops::CoerceUnsized;
 use core::ptr::{self, Shared};
 use core::marker::Unsize;
 use core::hash::{Hash, Hasher};
-use core::{usize, isize};
+use core::{isize, usize};
 use core::convert::From;
 use heap::deallocate;
 
@@ -608,11 +608,13 @@ impl<T> Weak<T> {
     #[stable(feature = "downgraded_weak", since = "1.10.0")]
     pub fn new() -> Weak<T> {
         unsafe {
-            Weak { ptr: Shared::new(Box::into_raw(box ArcInner {
-                strong: atomic::AtomicUsize::new(0),
-                weak: atomic::AtomicUsize::new(1),
-                data: uninitialized(),
-            }))}
+            Weak {
+                ptr: Shared::new(Box::into_raw(box ArcInner {
+                    strong: atomic::AtomicUsize::new(0),
+                    weak: atomic::AtomicUsize::new(1),
+                    data: uninitialized(),
+                })),
+            }
         }
     }
 }
@@ -655,7 +657,9 @@ impl<T: ?Sized> Weak<T> {
 
             // See comments in `Arc::clone` for why we do this (for `mem::forget`).
             if n > MAX_REFCOUNT {
-                unsafe { abort(); }
+                unsafe {
+                    abort();
+                }
             }
 
             // Relaxed is valid for the same reason it is on Arc's Clone impl
@@ -946,7 +950,7 @@ mod tests {
     use std::mem::drop;
     use std::ops::Drop;
     use std::option::Option;
-    use std::option::Option::{Some, None};
+    use std::option::Option::{None, Some};
     use std::sync::atomic;
     use std::sync::atomic::Ordering::{Acquire, SeqCst};
     use std::thread;