chiark / gitweb /
slotkey_write
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Jun 2020 12:37:31 +0000 (13:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Jun 2020 12:37:31 +0000 (13:37 +0100)
src/gamestate.rs

index 8bbc926c46504cbf41b68070cf6511ec9244914d..bf325f7e62a9f0010d6e93c46360fbe4adc6bafc 100644 (file)
@@ -25,10 +25,8 @@ pub struct PieceRenderInstructions {
 pub type VisiblePieceIdSvgIds = &'static [&'static str];
 
 impl Display for VisiblePieceId {
-  fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-    let v = self.0.as_ffi();
-    write!(f, "{}.{}", v >> 32, v & 0xffffffff)
-  }
+  #[throws(fmt::Error)]
+  fn fmt(&self, f : &mut fmt::Formatter) { slotkey_write(self.0,f)? }
 }
 display_consequential_impls!{VisiblePieceId}