From a844dd356fafe5881ff424d2779eebe3a90cdeff Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 24 Mar 2021 12:01:16 +0000 Subject: [PATCH] hidden recalc actually do: Provide occ not just notches from closure Signed-off-by: Ian Jackson --- src/hidden.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hidden.rs b/src/hidden.rs index 855a0db1..f08e145f 100644 --- a/src/hidden.rs +++ b/src/hidden.rs @@ -539,22 +539,24 @@ fn recalculate_occultation_general< dbgc!(&puos, &log, &occulteds); (||{ - let notches: - &mut dyn for<'g> FnMut(&'g mut GameOccults, OccId) -> &mut Notches + let occultation: + &mut dyn for<'g> FnMut(&'g mut GameOccults, OccId) -> &mut Occultation = &mut |goccults, occid| // rust-lang/rust/issues/58525 { to_permute.mark_dirty(occid); - &mut goccults.occults.get_mut(occid).unwrap().notches + goccults.occults.get_mut(occid).unwrap() }; if let Some((occid, old_notch)) = occulteds.old { - notches(goccults, occid) + occultation(goccults, occid) + .notches .remove(piece, old_notch) .unwrap() }; let passive = if let Some(occid) = occulteds.new { let zg = gen.next(); - let notch = notches(goccults, occid) + let occ = occultation(goccults, occid); + let notch = occ.notches .insert(zg, piece); Some(Passive { occid, notch }) } else { -- 2.30.2