From 98a3c297c2164c78ef3602f6e103b136d4007fe7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 27 Feb 2021 00:59:06 +0000 Subject: [PATCH] apitest: Prep refactor updates Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 388fa7d8..0776d2a2 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -245,13 +245,20 @@ impl Session { } #[throws(AE)] - fn synch(&mut self, su: &mut SetupCore) { + fn synchx< + F: FnMut(&mut Session, Generation, &str, &serde_json::Value), + > (&mut self, su: &mut SetupCore, mut f: F) { let exp = mgmt_game_synch(&mut su.mgmt_conn, TABLE.parse().unwrap())?; self.await_update( - |session, gen | (gen == exp).as_option(), - |_session, _gen, _k, _v| None, + |session, gen | (gen == exp).as_option(), + |session, gen, k, v| { f(session,gen,k,v); None }, )?; } + + #[throws(AE)] + fn synch(&mut self, su: &mut SetupCore) { + self.synchx(su, |_session, _gen, _k, _v|() )?; + } } impl Ctx { -- 2.30.2