@@ -189,8 +189,7 @@ impl WalltimeBenchmark {
189189 }
190190
191191 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) ;
194193 std:: fs:: create_dir_all ( & output_dir) . unwrap ( ) ;
195194 let bench_id = uuid:: Uuid :: new_v4 ( ) . to_string ( ) ;
196195 let output_path = output_dir. join ( format ! ( "{}.json" , bench_id) ) ;
@@ -233,7 +232,7 @@ impl WalltimeResults {
233232 // retrieve data from `{workspace_root}/target/codspeed/raw_results/{scope}/*.json
234233 let benchmarks = glob:: glob ( & format ! (
235234 "{}/**/*.json" ,
236- WalltimeResults :: result_dir_from_workspace_root( workspace_root)
235+ result_dir_from_workspace_root( workspace_root)
237236 . to_str( )
238237 . unwrap( ) ,
239238 ) ) ?
@@ -258,28 +257,28 @@ impl WalltimeResults {
258257 }
259258
260259 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) ;
262261 std:: fs:: remove_dir_all ( & raw_results_dir) . ok ( ) ; // ignore errors when the directory does not exist
263262 std:: fs:: create_dir_all ( & raw_results_dir)
264263 . context ( "Failed to create raw_results directory" ) ?;
265264 Ok ( ( ) )
266265 }
267266
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-
278267 pub fn benchmarks ( & self ) -> & [ WalltimeBenchmark ] {
279268 & self . benchmarks
280269 }
281270}
282271
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+
283282#[ cfg( test) ]
284283mod tests {
285284 use super :: * ;
0 commit comments