From bd43594d245f243a116e4baf37260d73a3dba688 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 22 Mar 2021 01:35:37 +0000 Subject: [PATCH] shapelib: Show things better when they are occulted Signed-off-by: Ian Jackson --- src/shapelib.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/shapelib.rs b/src/shapelib.rs index e2041357..242558b7 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -257,13 +257,10 @@ impl Item { #[throws(IE)] fn describe_face(&self, face: FaceId) -> Html { - if let Some(face) = self.faces.get(face) { - self.descs[ face.desc ].clone() - } else if let Some(back) = &self.back { - back.describe_html()? - } else { - throw!(internal_error_bydebug(&(self, face))) - } + // When we are not occulted, we can show are true identity + // even if we have a back. + let face = self.faces.get(face).unwrap_or(&self.faces[0]); + self.descs[ face.desc ].clone() } } -- 2.30.2