chiark / gitweb /
mformat 2: Actually tolerate missing size during deser
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 May 2022 20:46:22 +0000 (21:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 May 2022 23:19:17 +0000 (00:19 +0100)
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 <ijackson@chiark.greenend.org.uk>
src/shapelib-toml.rs

index 0def899844a6615ee12e90236ebd9a443edbe89c..e81bafe3d70e1366f0d92f2a1d282d660f1ccda7 100644 (file)
@@ -21,7 +21,7 @@ pub struct GroupDefn {
 #[derive(Debug,Deserialize)]
 pub struct GroupDetails {
   #[cfg(doc)] inherit: String, // handled specially
-  pub size: Vec<f64>,  // scaled when put into GroupData
+  #[serde(default)] pub size: Vec<f64>, // scaled in GroupData in mf1
   #[serde(default)] pub orig_size: Vec<f64>,
   #[serde(default)] pub centre: Option<[f64; 2]>,
   #[serde(default)] pub flip: bool,