7272use boxed:: Box ;
7373
7474use core:: sync:: atomic;
75- use core:: sync:: atomic:: Ordering :: { Relaxed , Release , Acquire , SeqCst } ;
75+ use core:: sync:: atomic:: Ordering :: { Acquire , Relaxed , Release , SeqCst } ;
7676use core:: borrow;
7777use core:: fmt;
7878use core:: cmp:: Ordering ;
@@ -85,7 +85,7 @@ use core::ops::CoerceUnsized;
8585use core:: ptr:: { self , Shared } ;
8686use core:: marker:: Unsize ;
8787use core:: hash:: { Hash , Hasher } ;
88- use core:: { usize , isize } ;
88+ use core:: { isize , usize } ;
8989use core:: convert:: From ;
9090use heap:: deallocate;
9191
@@ -608,11 +608,13 @@ impl<T> Weak<T> {
608608 #[ stable( feature = "downgraded_weak" , since = "1.10.0" ) ]
609609 pub fn new ( ) -> Weak < T > {
610610 unsafe {
611- Weak { ptr : Shared :: new ( Box :: into_raw ( box ArcInner {
612- strong : atomic:: AtomicUsize :: new ( 0 ) ,
613- weak : atomic:: AtomicUsize :: new ( 1 ) ,
614- data : uninitialized ( ) ,
615- } ) ) }
611+ Weak {
612+ ptr : Shared :: new ( Box :: into_raw ( box ArcInner {
613+ strong : atomic:: AtomicUsize :: new ( 0 ) ,
614+ weak : atomic:: AtomicUsize :: new ( 1 ) ,
615+ data : uninitialized ( ) ,
616+ } ) ) ,
617+ }
616618 }
617619 }
618620}
@@ -655,7 +657,9 @@ impl<T: ?Sized> Weak<T> {
655657
656658 // See comments in `Arc::clone` for why we do this (for `mem::forget`).
657659 if n > MAX_REFCOUNT {
658- unsafe { abort ( ) ; }
660+ unsafe {
661+ abort ( ) ;
662+ }
659663 }
660664
661665 // Relaxed is valid for the same reason it is on Arc's Clone impl
@@ -946,7 +950,7 @@ mod tests {
946950 use std:: mem:: drop;
947951 use std:: ops:: Drop ;
948952 use std:: option:: Option ;
949- use std:: option:: Option :: { Some , None } ;
953+ use std:: option:: Option :: { None , Some } ;
950954 use std:: sync:: atomic;
951955 use std:: sync:: atomic:: Ordering :: { Acquire , SeqCst } ;
952956 use std:: thread;
0 commit comments