@@ -189,8 +189,7 @@ impl WalltimeBenchmark {
189
189
}
190
190
191
191
fn dump_to_results ( & self , workspace_root : & Path , scope : & str ) {
192
- let output_dir =
193
- WalltimeResults :: result_dir_from_workspace_root ( workspace_root) . join ( scope) ;
192
+ let output_dir = result_dir_from_workspace_root ( workspace_root) . join ( scope) ;
194
193
std:: fs:: create_dir_all ( & output_dir) . unwrap ( ) ;
195
194
let bench_id = uuid:: Uuid :: new_v4 ( ) . to_string ( ) ;
196
195
let output_path = output_dir. join ( format ! ( "{}.json" , bench_id) ) ;
@@ -233,7 +232,7 @@ impl WalltimeResults {
233
232
// retrieve data from `{workspace_root}/target/codspeed/raw_results/{scope}/*.json
234
233
let benchmarks = glob:: glob ( & format ! (
235
234
"{}/**/*.json" ,
236
- WalltimeResults :: result_dir_from_workspace_root( workspace_root)
235
+ result_dir_from_workspace_root( workspace_root)
237
236
. to_str( )
238
237
. unwrap( ) ,
239
238
) ) ?
@@ -258,28 +257,28 @@ impl WalltimeResults {
258
257
}
259
258
260
259
pub fn clear ( workspace_root : & Path ) -> Result < ( ) > {
261
- let raw_results_dir = WalltimeResults :: result_dir_from_workspace_root ( workspace_root) ;
260
+ let raw_results_dir = result_dir_from_workspace_root ( workspace_root) ;
262
261
std:: fs:: remove_dir_all ( & raw_results_dir) . ok ( ) ; // ignore errors when the directory does not exist
263
262
std:: fs:: create_dir_all ( & raw_results_dir)
264
263
. context ( "Failed to create raw_results directory" ) ?;
265
264
Ok ( ( ) )
266
265
}
267
266
268
- // FIXME: This assumes that the cargo target dir is `target`, and duplicates information with
269
- // `cargo-codspeed::helpers::get_codspeed_target_dir`
270
- fn result_dir_from_workspace_root ( workspace_root : & Path ) -> PathBuf {
271
- workspace_root
272
- . join ( "target" )
273
- . join ( "codspeed" )
274
- . join ( "walltime" )
275
- . join ( "raw_results" )
276
- }
277
-
278
267
pub fn benchmarks ( & self ) -> & [ WalltimeBenchmark ] {
279
268
& self . benchmarks
280
269
}
281
270
}
282
271
272
+ // FIXME: This assumes that the cargo target dir is `target`, and duplicates information with
273
+ // `cargo-codspeed::helpers::get_codspeed_target_dir`
274
+ fn result_dir_from_workspace_root ( workspace_root : & Path ) -> PathBuf {
275
+ workspace_root
276
+ . join ( "target" )
277
+ . join ( "codspeed" )
278
+ . join ( "walltime" )
279
+ . join ( "raw_results" )
280
+ }
281
+
283
282
#[ cfg( test) ]
284
283
mod tests {
285
284
use super :: * ;
0 commit comments