chiark / gitweb /
jstest: Change type of piece id
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 9 Jul 2021 00:26:36 +0000 (01:26 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 9 Jul 2021 00:26:36 +0000 (01:26 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
jstest/jst-lower.rs

index b1f04638fe67c5f495f68bb66cb1d6e3e34be954..46c18d823b088d81038f26cc8ba3440e983b56ff 100644 (file)
@@ -29,7 +29,7 @@ macro_rules! sp {
 #[derive(Eq,PartialEq,Ord,PartialOrd)]
 #[derive(Serialize)]
 pub struct StartPiece {
-  id: String,
+  id: VisiblePieceId,
   pinned: bool,
   moveable: PieceMoveable,
   z: ZCoord,
@@ -133,7 +133,7 @@ impl TestsAccumulator {
     let mut zm = ZCoord::default().clone_mut();
     let pieces = pieces.into_iter().map(
       |StartPieceSpec { id, pinned, moveable }| {
-        let id = id.into();
+        let id = id.try_into().unwrap();
         let z = zm.increment().unwrap();
         StartPiece { id, pinned, moveable, z }
       }