@@ -4,25 +4,25 @@ macro_rules! runtime_methods {
44 use std:: future:: Future ;
55
66 pub fn spawn<F >( future: F ) -> JoinHandle <F :: Output >
7- where
8- F : Future + Send + ' static ,
9- F :: Output : Send + ' static ,
7+ where
8+ F : Future + Send + ' static ,
9+ F :: Output : Send + ' static ,
1010 {
1111 RUNTIME . spawn( future)
1212 }
1313
1414 pub fn spawn_blocking<F , T >( task: F ) -> JoinHandle <T >
15- where
16- F : FnOnce ( ) -> T + Send + ' static ,
17- T : Send + ' static ,
15+ where
16+ F : FnOnce ( ) -> T + Send + ' static ,
17+ T : Send + ' static ,
1818 {
1919 RUNTIME . spawn_blocking( task)
2020 }
2121
2222 pub fn block_on<F >( future: F ) -> F :: Output
23- where
24- F : Future + Send + ' static ,
25- F :: Output : Send + ' static ,
23+ where
24+ F : Future + Send + ' static ,
25+ F :: Output : Send + ' static ,
2626 {
2727 RUNTIME . block_on( future)
2828 }
@@ -31,54 +31,50 @@ macro_rules! runtime_methods {
3131
3232#[ cfg( feature = "bastion" ) ]
3333pub mod runtime {
34+ use agnostik:: executors:: BastionExecutor ;
35+ use agnostik:: { Agnostik , AgnostikExecutor } ;
3436 use once_cell:: sync:: Lazy ;
35- use agnostik:: { AgnostikExecutor , Agnostik } ;
36- use agnostik:: executors:: { BastionExecutor } ;
3737
38- static RUNTIME : Lazy < BastionExecutor > = Lazy :: new ( || unsafe {
39- std:: mem:: transmute ( Agnostik :: bastion ( ) )
40- } ) ;
38+ static RUNTIME : Lazy < BastionExecutor > =
39+ Lazy :: new ( || unsafe { std:: mem:: transmute ( Agnostik :: bastion ( ) ) } ) ;
4140
4241 runtime_methods ! ( ) ;
4342}
4443
4544#[ cfg( feature = "tokio" ) ]
4645pub mod runtime {
47- use once_cell:: sync:: Lazy ;
48- use agnostik:: { Agnostik , LocalAgnostikExecutor } ;
4946 use agnostik:: executors:: TokioExecutor ;
47+ use agnostik:: { Agnostik , LocalAgnostikExecutor } ;
48+ use once_cell:: sync:: Lazy ;
5049
51- static RUNTIME : Lazy < TokioExecutor > = Lazy :: new ( || unsafe {
52- std:: mem:: transmute ( Agnostik :: tokio ( ) )
53- } ) ;
50+ static RUNTIME : Lazy < TokioExecutor > =
51+ Lazy :: new ( || unsafe { std:: mem:: transmute ( Agnostik :: tokio ( ) ) } ) ;
5452
5553 runtime_methods ! ( ) ;
5654}
5755
5856#[ cfg( feature = "asyncstd" ) ]
5957pub mod runtime {
60- use once_cell:: sync:: Lazy ;
61- use agnostik:: { Agnostik , LocalAgnostikExecutor } ;
6258 use agnostik:: executors:: AsyncStdExecutor ;
59+ use agnostik:: { Agnostik , LocalAgnostikExecutor } ;
60+ use once_cell:: sync:: Lazy ;
6361
64- static RUNTIME : Lazy < AsyncStdExecutor > = Lazy :: new ( || unsafe {
65- std:: mem:: transmute ( Agnostik :: async_std ( ) )
66- } ) ;
62+ static RUNTIME : Lazy < AsyncStdExecutor > =
63+ Lazy :: new ( || unsafe { std:: mem:: transmute ( Agnostik :: async_std ( ) ) } ) ;
6764
6865 runtime_methods ! ( ) ;
6966}
7067
7168#[ cfg( feature = "smol" ) ]
7269pub mod runtime {
73- use once_cell:: sync:: Lazy ;
74- use agnostik:: { Agnostik , LocalAgnostikExecutor } ;
7570 use agnostik:: executors:: SmolExecutor ;
71+ use agnostik:: { Agnostik , LocalAgnostikExecutor } ;
72+ use once_cell:: sync:: Lazy ;
7673
77- static RUNTIME : Lazy < SmolExecutor > = Lazy :: new ( || unsafe {
78- std:: mem:: transmute ( Agnostik :: smol ( ) )
79- } ) ;
74+ static RUNTIME : Lazy < SmolExecutor > =
75+ Lazy :: new ( || unsafe { std:: mem:: transmute ( Agnostik :: smol ( ) ) } ) ;
8076
8177 runtime_methods ! ( ) ;
8278}
8379
84- pub use runtime:: * ;
80+ pub use runtime:: * ;
0 commit comments