From: Ian Jackson Date: Wed, 11 May 2022 20:46:22 +0000 (+0100) Subject: mformat 2: Actually tolerate missing size during deser X-Git-Tag: otter-1.1.0~243 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=0c70eebc988a56c83d5d733d79baeb66a25d439d;p=otter.git mformat 2: Actually tolerate missing size during deser We don't parse this properly yet, but we will. This bug was found in testing (with commits further down the branch) but I have rebased it next to the code that introduces the bug. Also explain that the weird scaling in GroupData only happens in mf1. Signed-off-by: Ian Jackson --- diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index 0def8998..e81bafe3 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -21,7 +21,7 @@ pub struct GroupDefn { #[derive(Debug,Deserialize)] pub struct GroupDetails { #[cfg(doc)] inherit: String, // handled specially - pub size: Vec, // scaled when put into GroupData + #[serde(default)] pub size: Vec, // scaled in GroupData in mf1 #[serde(default)] pub orig_size: Vec, #[serde(default)] pub centre: Option<[f64; 2]>, #[serde(default)] pub flip: bool,