@@ -172,7 +172,8 @@ const DOCKER_PROCESS_TIMEOUT_HARD: Duration = Duration::from_secs(60);
172
172
173
173
impl Sandbox {
174
174
pub fn new ( ) -> Result < Self > {
175
- let scratch = TempDir :: new ( "playground" ) . context ( UnableToCreateTempDirSnafuSnafu ) ?;
175
+ let scratch =
176
+ TempDir :: new ( "playground" ) . context ( UnableToCreateTempDirSnafuSnafu ) ?;
176
177
let input_file = scratch. path ( ) . join ( "input.rs" ) ;
177
178
let output_dir = scratch. path ( ) . join ( "output" ) ;
178
179
fs:: create_dir ( & output_dir) . context ( UnableToCreateOutputDirSnafuSnafu ) ?;
@@ -299,7 +300,10 @@ async fn run_command_with_timeout(mut command: Command) -> Result<std::process::
299
300
300
301
let timeout = DOCKER_PROCESS_TIMEOUT_HARD ;
301
302
println ! ( "executing command!" ) ;
302
- let output = command. output ( ) . await . context ( UnableToStartCompilerSnafuSnafu ) ?;
303
+ let output = command
304
+ . output ( )
305
+ . await
306
+ . context ( UnableToStartCompilerSnafuSnafu ) ?;
303
307
println ! ( "Done! {:?}" , output) ;
304
308
// Exit early, in case we don't have the container
305
309
// if !output.status.success() {
@@ -308,7 +312,11 @@ async fn run_command_with_timeout(mut command: Command) -> Result<std::process::
308
312
// let response = &output.stdout;
309
313
let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
310
314
311
- let id = stdout. lines ( ) . next ( ) . context ( MissingCompilerIdSnafuSnafu ) ?. trim ( ) ;
315
+ let id = stdout
316
+ . lines ( )
317
+ . next ( )
318
+ . context ( MissingCompilerIdSnafuSnafu ) ?
319
+ . trim ( ) ;
312
320
let stderr = & output. stderr ;
313
321
314
322
// ----------
@@ -329,7 +337,7 @@ async fn run_command_with_timeout(mut command: Command) -> Result<std::process::
329
337
Ok ( ExitStatusExt :: from_raw ( code) )
330
338
}
331
339
Ok ( e) => return e. context ( UnableToWaitForCompilerSnafuSnafu ) , // Failed to run
332
- Err ( e) => Err ( e) , // Timed out
340
+ Err ( e) => Err ( e) , // Timed out
333
341
} ;
334
342
335
343
// ----------
@@ -347,7 +355,10 @@ async fn run_command_with_timeout(mut command: Command) -> Result<std::process::
347
355
"--force" , id
348
356
) ;
349
357
command. stdout ( std:: process:: Stdio :: null ( ) ) ;
350
- command. status ( ) . await . context ( UnableToRemoveCompilerSnafuSnafu ) ?;
358
+ command
359
+ . status ( )
360
+ . await
361
+ . context ( UnableToRemoveCompilerSnafuSnafu ) ?;
351
362
352
363
let code = timed_out. context ( CompilerExecutionTimedOutSnafuSnafu { timeout } ) ?;
353
364
0 commit comments