72
72
use boxed:: Box ;
73
73
74
74
use core:: sync:: atomic;
75
- use core:: sync:: atomic:: Ordering :: { Relaxed , Release , Acquire , SeqCst } ;
75
+ use core:: sync:: atomic:: Ordering :: { Acquire , Relaxed , Release , SeqCst } ;
76
76
use core:: borrow;
77
77
use core:: fmt;
78
78
use core:: cmp:: Ordering ;
@@ -85,7 +85,7 @@ use core::ops::CoerceUnsized;
85
85
use core:: ptr:: { self , Shared } ;
86
86
use core:: marker:: Unsize ;
87
87
use core:: hash:: { Hash , Hasher } ;
88
- use core:: { usize , isize } ;
88
+ use core:: { isize , usize } ;
89
89
use core:: convert:: From ;
90
90
use heap:: deallocate;
91
91
@@ -608,11 +608,13 @@ impl<T> Weak<T> {
608
608
#[ stable( feature = "downgraded_weak" , since = "1.10.0" ) ]
609
609
pub fn new ( ) -> Weak < T > {
610
610
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
+ }
616
618
}
617
619
}
618
620
}
@@ -655,7 +657,9 @@ impl<T: ?Sized> Weak<T> {
655
657
656
658
// See comments in `Arc::clone` for why we do this (for `mem::forget`).
657
659
if n > MAX_REFCOUNT {
658
- unsafe { abort ( ) ; }
660
+ unsafe {
661
+ abort ( ) ;
662
+ }
659
663
}
660
664
661
665
// Relaxed is valid for the same reason it is on Arc's Clone impl
@@ -946,7 +950,7 @@ mod tests {
946
950
use std:: mem:: drop;
947
951
use std:: ops:: Drop ;
948
952
use std:: option:: Option ;
949
- use std:: option:: Option :: { Some , None } ;
953
+ use std:: option:: Option :: { None , Some } ;
950
954
use std:: sync:: atomic;
951
955
use std:: sync:: atomic:: Ordering :: { Acquire , SeqCst } ;
952
956
use std:: thread;
0 commit comments