From: Ian Jackson Date: Fri, 9 Jul 2021 00:26:36 +0000 (+0100) Subject: jstest: Change type of piece id X-Git-Tag: otter-0.7.2~221 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fad188a96a8be2f6102a12b4921bfe60bdead141;p=otter.git jstest: Change type of piece id Signed-off-by: Ian Jackson --- diff --git a/jstest/jst-lower.rs b/jstest/jst-lower.rs index b1f04638..46c18d82 100644 --- a/jstest/jst-lower.rs +++ b/jstest/jst-lower.rs @@ -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 } }