From: Ian Jackson Date: Mon, 25 Apr 2022 00:01:05 +0000 (+0100) Subject: hidden: Have active_total_ppieces return usize X-Git-Tag: otter-1.1.0~446 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fec616d19c05a09563cd157724ff37251384684c;p=otter.git 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 --- 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) }