From fec616d19c05a09563cd157724ff37251384684c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 25 Apr 2022 01:01:05 +0100 Subject: [PATCH] hidden: Have active_total_ppieces return usize The fix for the un-notched pieces bug is going to want to add a HashMap len to this, and that's usize. Signed-off-by: Ian Jackson --- src/hidden.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hidden.rs b/src/hidden.rs index 967d5aa3..26784e4e 100644 --- a/src/hidden.rs +++ b/src/hidden.rs @@ -142,10 +142,11 @@ impl PieceOccult { #[throws(IE)] pub fn active_total_ppieces(&self, goccults: &GameOccults) - -> Option { - self.active_occ(goccults)?.map( - |occ| occ.notches.len() - ) + -> Option { + self.active_occ(goccults)?.map(|occ| { + let notches_len = usize::try_from(occ.notches.len()).unwrap(); + notches_len + }) } pub fn passive_occid(&self) -> Option { Some(self.passive?.occid) } -- 2.30.2