From 0c70eebc988a56c83d5d733d79baeb66a25d439d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 11 May 2022 21:46:22 +0100 Subject: [PATCH] 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 --- src/shapelib-toml.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.30.2