From: Ian Jackson Date: Sun, 1 May 2022 10:15:44 +0000 (+0100) Subject: OpOutcomeThunk: replace the other open-coded resolution site X-Git-Tag: otter-1.1.0~376 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=90f922cecf094dc5186fc1fe74a2a2d8d9c9fb10;p=otter.git OpOutcomeThunk: replace the other open-coded resolution site Signed-off-by: Ian Jackson --- diff --git a/daemon/api.rs b/daemon/api.rs index fa76a0c9..956081d3 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -143,10 +143,8 @@ fn api_piece_op(form: Json>) })?; Ok::<_,ApiPieceOpError>((update, loose_conflict)) })().and_then(|(thunk, loose_conflict)| Ok(( - match thunk { - OpOutcomeThunk::Immediate(r) => r, - OpOutcomeThunk::Reborrow(f) => f(&mut ig, (player, piece))?, - }, loose_conflict + thunk.resolve(&mut ig, (player, piece))?, + loose_conflict, ))) { Err(APOE::Inapplicable(poe)) => { PrepareUpdatesBuffer::piece_report_error(