From: Ian Jackson Date: Sat, 27 Feb 2021 00:59:06 +0000 (+0000) Subject: apitest: Prep refactor updates X-Git-Tag: otter-0.4.0~336 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=98a3c297c2164c78ef3602f6e103b136d4007fe7;p=otter.git apitest: Prep refactor updates Signed-off-by: Ian Jackson --- 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 {