@@ -26,7 +26,7 @@ impl BuildOptions<'_> {
2626        & self , 
2727        metadata :  & Metadata , 
2828        quiet :  bool , 
29-         measurement_mode :  MeasurementMode , 
29+         measurement_mode :  & MeasurementMode , 
3030    )  -> Result < Vec < BuiltBench > >  { 
3131        let  workspace_packages = metadata. workspace_packages ( ) ; 
3232
@@ -106,7 +106,7 @@ impl BuildOptions<'_> {
106106
107107    /// Generates a subcommand to build the benchmarks by invoking cargo and forwarding the filters 
108108/// This command explicitly ignores the `self.benches`: all benches are built 
109- fn  build_command ( & self ,  measurement_mode :  MeasurementMode )  -> Command  { 
109+ fn  build_command ( & self ,  measurement_mode :  & MeasurementMode )  -> Command  { 
110110        let  mut  cargo = Command :: new ( "cargo" ) ; 
111111        cargo. args ( [ "build" ,  "--benches" ] ) ; 
112112
@@ -115,7 +115,7 @@ impl BuildOptions<'_> {
115115        rust_flags. push_str ( " -C debuginfo=2" ) ; 
116116
117117        // Add the codspeed cfg flag if instrumentation mode is enabled 
118-         if  measurement_mode == MeasurementMode :: Instrumentation  { 
118+         if  * measurement_mode == MeasurementMode :: Instrumentation  { 
119119            rust_flags. push_str ( " --cfg codspeed" ) ; 
120120        } 
121121        cargo. env ( "RUSTFLAGS" ,  rust_flags) ; 
@@ -165,7 +165,7 @@ pub fn build_benches(
165165        features :  & features, 
166166        profile :  & profile, 
167167    } 
168-     . build ( metadata,  quiet,  measurement_mode) ?; 
168+     . build ( metadata,  quiet,  & measurement_mode) ?; 
169169
170170    if  built_benches. is_empty ( )  { 
171171        bail ! ( 
@@ -174,7 +174,7 @@ pub fn build_benches(
174174        ) ; 
175175    } 
176176
177-     let  codspeed_target_dir = get_codspeed_target_dir ( metadata) ; 
177+     let  codspeed_target_dir = get_codspeed_target_dir ( metadata,   & measurement_mode ) ; 
178178    let  built_bench_count = built_benches. len ( ) ; 
179179
180180    // Create and clear packages codspeed target directories 
0 commit comments