@@ -24,7 +24,7 @@ use axum_extra::{
24
24
headers:: { authorization:: Bearer , Authorization , CacheControl , ETag , IfNoneMatch } ,
25
25
TypedHeader ,
26
26
} ;
27
- use futures:: { future :: BoxFuture , FutureExt , TryFutureExt } ;
27
+ use futures:: { FutureExt , TryFutureExt } ;
28
28
use orchestrator:: coordinator:: { self , CoordinatorFactory , DockerBackend , TRACKED_CONTAINERS } ;
29
29
use snafu:: prelude:: * ;
30
30
use std:: {
@@ -231,8 +231,8 @@ async fn evaluate(
231
231
Json ( req) : Json < api:: EvaluateRequest > ,
232
232
) -> Result < Json < api:: EvaluateResponse > > {
233
233
attempt_record_request ( db, req, |req| async {
234
- with_coordinator ( & factory. 0 , req, |c, req| {
235
- c. execute ( req) . context ( EvaluateSnafu ) . boxed ( )
234
+ with_coordinator ( & factory. 0 , req, async |c, req| {
235
+ c. execute ( req) . context ( EvaluateSnafu ) . await
236
236
} )
237
237
. await
238
238
. map ( Json )
@@ -246,8 +246,8 @@ async fn compile(
246
246
Json ( req) : Json < api:: CompileRequest > ,
247
247
) -> Result < Json < api:: CompileResponse > > {
248
248
attempt_record_request ( db, req, |req| async {
249
- with_coordinator ( & factory. 0 , req, |c, req| {
250
- c. compile ( req) . context ( CompileSnafu ) . boxed ( )
249
+ with_coordinator ( & factory. 0 , req, async |c, req| {
250
+ c. compile ( req) . context ( CompileSnafu ) . await
251
251
} )
252
252
. await
253
253
. map ( Json )
@@ -261,8 +261,8 @@ async fn execute(
261
261
Json ( req) : Json < api:: ExecuteRequest > ,
262
262
) -> Result < Json < api:: ExecuteResponse > > {
263
263
attempt_record_request ( db, req, |req| async {
264
- with_coordinator ( & factory. 0 , req, |c, req| {
265
- c. execute ( req) . context ( ExecuteSnafu ) . boxed ( )
264
+ with_coordinator ( & factory. 0 , req, async |c, req| {
265
+ c. execute ( req) . context ( ExecuteSnafu ) . await
266
266
} )
267
267
. await
268
268
. map ( Json )
@@ -276,8 +276,8 @@ async fn format(
276
276
Json ( req) : Json < api:: FormatRequest > ,
277
277
) -> Result < Json < api:: FormatResponse > > {
278
278
attempt_record_request ( db, req, |req| async {
279
- with_coordinator ( & factory. 0 , req, |c, req| {
280
- c. format ( req) . context ( FormatSnafu ) . boxed ( )
279
+ with_coordinator ( & factory. 0 , req, async |c, req| {
280
+ c. format ( req) . context ( FormatSnafu ) . await
281
281
} )
282
282
. await
283
283
. map ( Json )
@@ -291,8 +291,8 @@ async fn clippy(
291
291
Json ( req) : Json < api:: ClippyRequest > ,
292
292
) -> Result < Json < api:: ClippyResponse > > {
293
293
attempt_record_request ( db, req, |req| async {
294
- with_coordinator ( & factory. 0 , req, |c, req| {
295
- c. clippy ( req) . context ( ClippySnafu ) . boxed ( )
294
+ with_coordinator ( & factory. 0 , req, async |c, req| {
295
+ c. clippy ( req) . context ( ClippySnafu ) . await
296
296
} )
297
297
. await
298
298
. map ( Json )
@@ -306,8 +306,8 @@ async fn miri(
306
306
Json ( req) : Json < api:: MiriRequest > ,
307
307
) -> Result < Json < api:: MiriResponse > > {
308
308
attempt_record_request ( db, req, |req| async {
309
- with_coordinator ( & factory. 0 , req, |c, req| {
310
- c. miri ( req) . context ( MiriSnafu ) . boxed ( )
309
+ with_coordinator ( & factory. 0 , req, async |c, req| {
310
+ c. miri ( req) . context ( MiriSnafu ) . await
311
311
} )
312
312
. await
313
313
. map ( Json )
@@ -321,8 +321,8 @@ async fn macro_expansion(
321
321
Json ( req) : Json < api:: MacroExpansionRequest > ,
322
322
) -> Result < Json < api:: MacroExpansionResponse > > {
323
323
attempt_record_request ( db, req, |req| async {
324
- with_coordinator ( & factory. 0 , req, |c, req| {
325
- c. macro_expansion ( req) . context ( MacroExpansionSnafu ) . boxed ( )
324
+ with_coordinator ( & factory. 0 , req, async |c, req| {
325
+ c. macro_expansion ( req) . context ( MacroExpansionSnafu ) . await
326
326
} )
327
327
. await
328
328
. map ( Json )
@@ -430,10 +430,10 @@ impl Outcome {
430
430
}
431
431
}
432
432
433
- async fn with_coordinator < WebReq , WebResp , Req , Resp , F > (
433
+ async fn with_coordinator < WebReq , WebResp , Req , Resp > (
434
434
factory : & CoordinatorFactory ,
435
435
req : WebReq ,
436
- f : F ,
436
+ f : impl AsyncFnOnce ( & coordinator :: Coordinator < DockerBackend > , Req ) -> Result < Resp > ,
437
437
) -> Result < WebResp >
438
438
where
439
439
WebReq : TryInto < Req > ,
@@ -442,8 +442,6 @@ where
442
442
Req : HasLabelsCore ,
443
443
Resp : Into < WebResp > ,
444
444
Resp : IsSuccess ,
445
- for < ' f > F :
446
- FnOnce ( & ' f coordinator:: Coordinator < DockerBackend > , Req ) -> BoxFuture < ' f , Result < Resp > > ,
447
445
{
448
446
let coordinator = factory. build ( ) ;
449
447
0 commit comments