@@ -23,29 +23,6 @@ use std::marker::PhantomData;
2323use std:: ops:: { Deref , DerefMut } ;
2424use crate :: owning_ref:: { Erased , OwningRef } ;
2525
26- pub fn serial_join < A , B , RA , RB > ( oper_a : A , oper_b : B ) -> ( RA , RB )
27- where A : FnOnce ( ) -> RA ,
28- B : FnOnce ( ) -> RB
29- {
30- ( oper_a ( ) , oper_b ( ) )
31- }
32-
33- pub struct SerialScope ;
34-
35- impl SerialScope {
36- pub fn spawn < F > ( & self , f : F )
37- where F : FnOnce ( & SerialScope )
38- {
39- f ( self )
40- }
41- }
42-
43- pub fn serial_scope < F , R > ( f : F ) -> R
44- where F : FnOnce ( & SerialScope ) -> R
45- {
46- f ( & SerialScope )
47- }
48-
4926pub use std:: sync:: atomic:: Ordering :: SeqCst ;
5027pub use std:: sync:: atomic:: Ordering ;
5128
@@ -64,6 +41,29 @@ cfg_if! {
6441 }
6542 }
6643
44+ pub fn serial_join<A , B , RA , RB >( oper_a: A , oper_b: B ) -> ( RA , RB )
45+ where A : FnOnce ( ) -> RA ,
46+ B : FnOnce ( ) -> RB
47+ {
48+ ( oper_a( ) , oper_b( ) )
49+ }
50+
51+ pub struct SerialScope ;
52+
53+ impl SerialScope {
54+ pub fn spawn<F >( & self , f: F )
55+ where F : FnOnce ( & SerialScope )
56+ {
57+ f( self )
58+ }
59+ }
60+
61+ pub fn serial_scope<F , R >( f: F ) -> R
62+ where F : FnOnce ( & SerialScope ) -> R
63+ {
64+ f( & SerialScope )
65+ }
66+
6767 use std:: ops:: Add ;
6868 use std:: panic:: { resume_unwind, catch_unwind, AssertUnwindSafe } ;
6969
0 commit comments