From: Ian Jackson Date: Sun, 1 Nov 2020 22:15:51 +0000 (+0000) Subject: wip errors from introducing accounts X-Git-Tag: otter-0.2.0~568 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bb27511388fed0ca18f01ccff5a2b394e66b5a2b;p=otter.git wip errors from introducing accounts Signed-off-by: Ian Jackson --- diff --git a/src/global.rs b/src/global.rs index 87bc5ae9..10c34a85 100644 --- a/src/global.rs +++ b/src/global.rs @@ -882,7 +882,7 @@ impl InstanceGuard<'_> { } let InstanceSaveAccesses:: - { mut tokens_players, mut ipieces, mut aplayers, acl } + { tokens_players, mut ipieces, mut aplayers, acl } = match Self::load_something(&name, "a-") { Ok(data) => data, Err(e) => if (||{ @@ -907,14 +907,14 @@ impl InstanceGuard<'_> { secondary.retain(|k,_v| primary.contains_key(k)); } - discard_mismatches(&mut gs.players, &mut aplayers); - discard_mismatches(&mut gs.pieces, &mut ipieces); + discard_mismatches(&mut gs.players, &mut aplayers); + discard_mismatches(&mut gs.pieces.0, &mut ipieces); let pu_bc = PlayerUpdates::new_begin(&gs); let iplayers : SecondarySlotMap = { let a = aplayers; - a.drain() + a.into_iter() }.map(|(player, ipl)| { let u = pu_bc.new(); (player, PlayerRecord { u, ipl }) @@ -928,7 +928,7 @@ impl InstanceGuard<'_> { } let name = Arc::new(name); - let (tokens_players, acctids_players) = { + let (mut tokens_players, acctids_players) = { let mut tokens = Vec::with_capacity(tokens_players.len()); let mut acctids = Vec::with_capacity(tokens_players.len()); for (token, player) in tokens_players { if_chain! {