Skip to content

Commit 0eecb78

Browse files
committed
Pass connection as a mutable reference to the bench function
1 parent 5440839 commit 0eecb78

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

collector/src/bin/collector.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl BenchmarkErrors {
6565
#[allow(clippy::too_many_arguments)]
6666
fn bench(
6767
rt: &mut Runtime,
68-
mut conn: Box<dyn Connection>,
68+
conn: &mut dyn Connection,
6969
profiles: &[Profile],
7070
scenarios: &[Scenario],
7171
toolchain: &Toolchain,
@@ -96,7 +96,7 @@ fn bench(
9696
category: Category,
9797
print_intro: &dyn Fn(),
9898
measure: &dyn Fn(&mut BenchProcessor) -> anyhow::Result<()>| {
99-
let is_fresh = rt.block_on(collector.start_compile_step(conn.as_mut(), benchmark_name));
99+
let is_fresh = rt.block_on(collector.start_compile_step(conn, benchmark_name));
100100
if !is_fresh {
101101
skipped = true;
102102
eprintln!("skipping {} -- already benchmarked", benchmark_name);
@@ -783,7 +783,7 @@ fn main_result() -> anyhow::Result<i32> {
783783
benchmarks.retain(|b| b.category().is_primary_or_secondary());
784784

785785
let artifact_id = ArtifactId::Tag(toolchain.id.clone());
786-
let (conn, collector) = rt.block_on(init_compile_collector(
786+
let (mut conn, collector) = rt.block_on(init_compile_collector(
787787
&pool,
788788
&benchmarks,
789789
bench_rustc.bench_rustc,
@@ -792,7 +792,7 @@ fn main_result() -> anyhow::Result<i32> {
792792

793793
let res = bench(
794794
&mut rt,
795-
conn,
795+
conn.as_mut(),
796796
profiles,
797797
scenarios,
798798
&toolchain,
@@ -853,15 +853,15 @@ fn main_result() -> anyhow::Result<i32> {
853853
benchmarks.retain(|b| b.category().is_primary_or_secondary());
854854

855855
let artifact_id = ArtifactId::Commit(commit);
856-
let (conn, collector) = rt.block_on(init_compile_collector(
856+
let (mut conn, collector) = rt.block_on(init_compile_collector(
857857
&pool,
858858
&benchmarks,
859859
bench_rustc.bench_rustc,
860860
artifact_id,
861861
));
862862
let res = bench(
863863
&mut rt,
864-
conn,
864+
conn.as_mut(),
865865
&Profile::all(),
866866
&Scenario::all(),
867867
&Toolchain::from_sysroot(&sysroot, sha),
@@ -1065,15 +1065,15 @@ fn bench_published_artifact(
10651065
benchmarks.retain(|b| b.category().is_stable());
10661066

10671067
let artifact_id = ArtifactId::Tag(toolchain.id.clone());
1068-
let (conn, collector) = rt.block_on(init_compile_collector(
1068+
let (mut conn, collector) = rt.block_on(init_compile_collector(
10691069
&pool,
10701070
&benchmarks,
10711071
/* bench_rustc */ false,
10721072
artifact_id,
10731073
));
10741074
let res = bench(
10751075
rt,
1076-
conn,
1076+
conn.as_mut(),
10771077
&profiles,
10781078
&scenarios,
10791079
toolchain,

0 commit comments

Comments
 (0)