From 1582db3a9738b57e8e5e76bdaf496b596cc597fc Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Fri, 16 Aug 2024 14:11:59 +0100 Subject: [PATCH] borrow hugr --- hugr/benches/benchmarks/hugr.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hugr/benches/benchmarks/hugr.rs b/hugr/benches/benchmarks/hugr.rs index 5584dd36b..daea48184 100644 --- a/hugr/benches/benchmarks/hugr.rs +++ b/hugr/benches/benchmarks/hugr.rs @@ -67,7 +67,7 @@ impl Serializer for JsonSer { } } -fn roundtrip(hugr: Hugr, serializer: impl Serializer) -> Hugr { +fn roundtrip(hugr: &Hugr, serializer: impl Serializer) { let bytes = serializer.serialize(&hugr); serde_json::from_slice(&bytes).unwrap() } @@ -160,7 +160,7 @@ fn bench_serialization(c: &mut Criterion) { c.bench_function("simple_cfg_serialize", |b| { let h = simple_cfg_hugr(); b.iter(|| { - black_box(roundtrip(h.clone(), JsonSer)); + black_box(roundtrip(&h, JsonSer)); }); }); let mut group = c.benchmark_group("circuit_serialize"); @@ -169,7 +169,7 @@ fn bench_serialization(c: &mut Criterion) { group.bench_with_input(BenchmarkId::from_parameter(size), size, |b, &size| { let h = circuit(size); b.iter(|| { - black_box(roundtrip(h.clone(), JsonSer)); + black_box(roundtrip(&h, JsonSer)); }); }); }