From 8068253c1b16c9601836aeb72bee7ed954075a47 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 11 Apr 2022 10:45:39 +0100 Subject: [PATCH] Style: tidy up and use fehler Empirically, without the let r = ...; r, fehler and if_chain! produce a type error. That must be why we had the fehler use commented out. But this way it works. Signed-off-by: Ian Jackson --- src/pieces.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/pieces.rs b/src/pieces.rs index c213e1a3..a1563be1 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -133,19 +133,15 @@ impl PieceTrait for SimpleShape { _gs: &GameState, _vpid: VisiblePieceId) { self.svg_piece_raw(f, gpc.face, &mut |_|Ok(()))?; } -// #[throws(IE)] - fn describe_html(&self, gpc: &GPiece, _goccults: &GameOccults) -// -> Html --> Result - { -Ok::<_,IE>( - if_chain! { + #[throws(IE)] + fn describe_html(&self, gpc: &GPiece, _goccults: &GameOccults) -> Html { + let r = if_chain! { if let face = gpc.face; if let Some(colour) = self.colours.get(face); then { hformat!("a {} {}", colour, self.desc) } else { hformat!("a {}", self.desc) } - } -) + }; + r } fn nfaces(&self) -> RawFaceId { self.count_faces().try_into().unwrap() -- 2.30.2