From f05060bce8b4b2600e56809b43199a9b4d837dea Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 23 May 2022 19:07:33 +0100 Subject: [PATCH] angles: Reinstate compatibility with mf1 format We don't need to check the mformat, since the old syntax is disjoint from the new one. Signed-off-by: Ian Jackson --- src/spec.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/spec.rs b/src/spec.rs index 9fea2654..a5eb031f 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -235,6 +235,8 @@ pub struct PiecesSpec { pub enum PieceAngleSpec { Compass(String), Degrees(i32), + + CompatMF1 { #[serde(rename="Compass")] i: u8 }, } #[derive(Debug,Copy,Clone,Serialize,Deserialize)] @@ -680,6 +682,7 @@ pub mod imp { if deg % 45 != 0 { throw!(SpE::CompassAngleInvalid) } (deg / 45) as u8 }, + Some(PAS::CompatMF1 { i }) => *i, }; PieceAngle::Compass(i.try_into()?) } -- 2.30.2