From c972a4ffd58ed42f9c289921972b4f08f988e66a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 20 Mar 2021 18:29:43 +0000 Subject: [PATCH] Provide &InstanceRef in ApiPieceOpArgs Signed-off-by: Ian Jackson --- daemon/api.rs | 3 ++- src/gamestate.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/api.rs b/daemon/api.rs index 907c71f6..8de37284 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -105,7 +105,7 @@ fn api_piece_op(form: Json>) let mut ig = iad.gref.lock()?; ig.save_game_later(); - ToPermute::with(move |mut to_permute| { + ToPermute::with(|mut to_permute| { let r = (||{ let g = &mut *ig; @@ -140,6 +140,7 @@ fn api_piece_op(form: Json>) let update = form.op.op_complex(ApiPieceOpArgs { ioccults, gs, player, piece, ipieces, ipc, + ig: &iad.gref, to_permute: &mut to_permute, })?; Ok::<_,ApiPieceOpError>(update) diff --git a/src/gamestate.rs b/src/gamestate.rs index 7768107b..ad1ca4b8 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -169,6 +169,7 @@ pub trait OccultedPieceTrait: OutlineTrait + 'static { #[derive(Debug)] pub struct ApiPieceOpArgs<'a> { + pub ig: &'a InstanceRef, pub gs: &'a mut GameState, pub ipieces: &'a IPieces, pub ioccults: &'a IOccults, -- 2.30.2