chiark / gitweb /
abolish two pointless fn inner()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Mar 2021 20:11:32 +0000 (20:11 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Mar 2021 20:11:32 +0000 (20:11 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/gamestate.rs

index fb690c83f45cb35bc446aeafdf887d92a4d26f33..bf9ba072547dbe3cb9b3671737bd78d1fcbe5d65 100644 (file)
@@ -437,11 +437,7 @@ impl PieceRenderInstructions {
   pub fn make_defs<'p>(&self, ioccults: &IOccults,
                          gpc: &GPiece, ipc: &IPiece) -> Html
   {
-    #[throws(IE)]
-    fn inner(pri: &PieceRenderInstructions, ioccults: &IOccults,
-             gpc: &GPiece, ipc: &IPiece)
-             -> Html
-  {
+    let pri = self;
     let instead = pri.instead(ioccults, ipc)?;
 
     let o: &dyn OutlineTrait = match instead {
@@ -479,23 +475,16 @@ impl PieceRenderInstructions {
            pri.vpid, o.surround_path()?.0)?;
     defs
   }
-  inner(self, ioccults, gpc, ipc)?
-  }
 
   pub fn describe(&self, ioccults: &IOccults,
                   gpc: &GPiece, ipc: &IPiece) -> Html
   {
-    fn inner(pri: &PieceRenderInstructions, ioccults: &IOccults,
-             gpc: &GPiece, ipc: &IPiece) -> Html
-  {
-    pri.describe_fallible(ioccults, gpc, ipc)
+    self.describe_fallible(ioccults, gpc, ipc)
       .unwrap_or_else(|e| {
         error!("error describing piece: {:?}", e);
         Html::lit("<internal error describing piece>")
       })
   }
-  inner(self, ioccults, gpc, ipc)
-  }
 
   #[throws(IE)]
   pub fn describe_fallible(&self, ioccults: &IOccults,