From 555c4ae12b19f3d1db744a03fe5cb53330bcb7f3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 19 May 2022 21:29:40 +0100 Subject: [PATCH] fastsplit: No longer have fastsplit_delete insist on pass Signed-off-by: Ian Jackson --- src/currency.rs | 2 +- src/fastsplit.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/currency.rs b/src/currency.rs index 948b40cc..c3e5aca1 100644 --- a/src/currency.rs +++ b/src/currency.rs @@ -280,7 +280,7 @@ impl PieceTrait for Banknote { OpHookThunk::Reborrow(Box::new(move |igg: &mut InstanceGuard, (_player,)| { - let (puo, uu_d) = igg.fastsplit_delete(show, tpiece, &logents)?; + let (puo, uu_d) = igg.fastsplit_delete(tpiece, &logents)?; // commitment point Ok((move ||{ let ig = &mut **igg; diff --git a/src/fastsplit.rs b/src/fastsplit.rs index 472f9340..87d2b6da 100644 --- a/src/fastsplit.rs +++ b/src/fastsplit.rs @@ -167,7 +167,6 @@ impl InstanceGuard<'_> { #[throws(IE)] pub fn fastsplit_delete(&mut self, - show: ShowUnocculted, piece: PieceId, #[allow(clippy::ptr_arg)] _proof_that_caller_handles_logging: &Vec) @@ -180,7 +179,12 @@ impl InstanceGuard<'_> { let gpc = self.gs.pieces.get(piece).ok_or_else(missing_e)?; let ipc = self.ipieces.get(piece).ok_or_else(missing_e)?; - let _p: &Piece = ipc.p.show(show).downcast_piece()?; + + // If we are merging or deleting here, presumably someone has + // already checked that this is appropriate wrt occultations, + // since we don't just do that willy-nilly and occultation will + // have been checked when deciding *what* to merge with. + let _p: &Piece = ipc.p.direct_trait_access().downcast_piece()?; let _fsid: &FastSplitId = gpc.fastsplit.as_ref() .ok_or_else(|| internal_error_bydebug(gpc))?; -- 2.30.2