We don't need to check the mformat, since the old syntax is disjoint
from the new one.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
pub enum PieceAngleSpec {
Compass(String),
Degrees(i32),
pub enum PieceAngleSpec {
Compass(String),
Degrees(i32),
+
+ CompatMF1 { #[serde(rename="Compass")] i: u8 },
}
#[derive(Debug,Copy,Clone,Serialize,Deserialize)]
}
#[derive(Debug,Copy,Clone,Serialize,Deserialize)]
if deg % 45 != 0 { throw!(SpE::CompassAngleInvalid) }
(deg / 45) as u8
},
if deg % 45 != 0 { throw!(SpE::CompassAngleInvalid) }
(deg / 45) as u8
},
+ Some(PAS::CompatMF1 { i }) => *i,
};
PieceAngle::Compass(i.try_into()?)
}
};
PieceAngle::Compass(i.try_into()?)
}