These are more convenient now, and the authorisation trickery is
now where we can more clearly justify it.
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ok::<(),Fatal>(())
})();
- let g = &mut *ig;
- let gs = &mut g.gs;
-
- (r, to_recalculate.implement(&mut gs.players,
- &mut gs.pieces,
- &mut gs.occults,
- &g.ipieces))
+ (r, to_recalculate.implement(&mut ig))
});
PrepareUpdatesBuffer::only_unprepared(&mut ig, unprepared_outer);
})();
(r, {
- let ig = igu.by_mut(Authorisation::promise_any());
- let g = &mut **ig;
- let gs = &mut g.gs;
- to_permute.implement(&mut gs.players,
- &mut gs.pieces,
- &mut gs.occults,
- &g.ipieces)
+ to_permute.implement_auth(&mut *igu)
})
});
(r, uu)
}
pub fn mark_dirty(&mut self, occid: OccId) { self.outdated.insert(occid); }
- pub fn implement(self,
+
+ pub fn implement_auth<A>(self, igu: &mut Unauthorised<InstanceGuard,A>)
+ -> Implemented {
+ // Caller must have had some kind of authorisation to do whatever
+ // it was they did. It doesn't amke sense to demand any more.
+ self.implement(igu.by_mut(Authorisation::promise_any()))
+ }
+ pub fn implement(self, ig: &mut Instance) -> Implemented {
+ self.implement_inner(&mut ig.gs.players,
+ &mut ig.gs.pieces,
+ &mut ig.gs.occults,
+ &ig.ipieces)
+ }
+ fn implement_inner(self,
gplayers: &mut GPlayers,
gpieces: &mut GPieces,
goccults: &mut GOccults,