diff --git a/backend/src/mock/bus_checker.rs b/backend/src/mock/bus_checker.rs index 8339c1972d..b69b19dec1 100644 --- a/backend/src/mock/bus_checker.rs +++ b/backend/src/mock/bus_checker.rs @@ -179,33 +179,30 @@ impl<'a, F: FieldElement> BusChecker<'a, F> { }, ) // combine all the states to one - .reduce( - BusState::default, - |mut a, b| { - for (tuple, TupleState { sends, receives }) in b { - let TupleState { - sends: sends_a, - receives: receives_a, - } = a.entry(tuple).or_default(); - - for (bus_connection, count) in sends { - sends_a - .entry(bus_connection) - .and_modify(|sends| *sends += count) - .or_insert(count); - } + .reduce(BusState::default, |mut a, b| { + for (tuple, TupleState { sends, receives }) in b { + let TupleState { + sends: sends_a, + receives: receives_a, + } = a.entry(tuple).or_default(); + + for (bus_connection, count) in sends { + sends_a + .entry(bus_connection) + .and_modify(|sends| *sends += count) + .or_insert(count); + } - for (bus_connection, count) in receives { - receives_a - .entry(bus_connection) - .and_modify(|receives| *receives += count) - .or_insert(count); - } + for (bus_connection, count) in receives { + receives_a + .entry(bus_connection) + .and_modify(|receives| *receives += count) + .or_insert(count); } + } - a - }, - ); + a + }); let mut errors = vec![];