File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " eval-stack " : patch:perf
3
+ ---
4
+
5
+ Improve the performance of the async I/O operations.
Original file line number Diff line number Diff line change 1
- use std:: { fs :: create_dir_all , path:: PathBuf , time:: Duration } ;
1
+ use std:: { path:: PathBuf , time:: Duration } ;
2
2
3
3
use anyhow:: Result ;
4
+ use tokio:: fs:: { create_dir_all, remove_dir_all} ;
4
5
use which:: which;
5
6
6
7
use crate :: {
25
26
let workspace: PathBuf = workspace. into ( ) ;
26
27
27
28
if !workspace. exists ( ) {
28
- create_dir_all ( & workspace) ?;
29
+ create_dir_all ( & workspace) . await ?;
29
30
}
30
31
31
32
let source_file_path = Into :: < PathBuf > :: into ( source_file_path)
97
98
}
98
99
99
100
if clean {
100
- if let Err ( e) = std :: fs :: remove_dir_all ( workspace) {
101
+ if let Err ( e) = remove_dir_all ( workspace) . await {
101
102
anyhow:: bail!( "Failed to remove workspace: {}" , e) ;
102
103
}
103
104
}
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ pub async fn handle_submission(
98
98
submission
99
99
. test_cases
100
100
. into_iter ( )
101
- . map ( |_tc | ( "tests/1.in" , "tests/1.out" ) )
101
+ . map ( |tc | ( tc . input , tc . output ) )
102
102
. collect ( ) ,
103
103
true ,
104
104
)
You can’t perform that action at this time.
0 commit comments