From: Ian Jackson Date: Mon, 23 May 2022 18:07:33 +0000 (+0100) Subject: angles: Reinstate compatibility with mf1 format X-Git-Tag: otter-1.1.0~19 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f05060bce8b4b2600e56809b43199a9b4d837dea;p=otter.git 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 --- 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()?) }