chiark / gitweb /
shapelib: Parse the r_file_spec into the Filedata
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 22 May 2021 17:39:59 +0000 (18:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 22 May 2021 17:39:59 +0000 (18:39 +0100)
Nothing uses this yet.  We're going to use it for bundle shapes.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/shapelib-toml.rs
src/shapelib.rs

index 9b9922eb0a698b4288d4d904943d2bc19dbb35c7..a9464130ae483b3e275d02f0357b9996a50af886 100644 (file)
@@ -241,8 +241,7 @@ pub struct FileData {
   ///
   /// When [`scraper.method`](LibraryTomlFile::scraper) is `"none"`,
   /// this field is not used and is conventionally set to "`-`".
-  #[cfg(doc)] pub r_file_spec: String,
-  #[cfg(not(doc))] pub r_file_spec: (),
+  pub r_file_spec: String,
 
   /// Extra fields, normally not present.
   pub extra_fields: HashMap<String, String>,
index a2d166c1373a9bcf9cbcb5a4ae718a1e2b0ebbf3..87249a7f314f8c844db556f1f11b0918a4a3fb3e 100644 (file)
@@ -1094,12 +1094,12 @@ impl TryFrom<String> for FileList {
         Ok::<_,LLE>(l.to_owned())
       };
       let item_spec = n()?;
-      let _r_file_spec = n()?;
+      let r_file_spec = n()?;
       let extra_fields = xfields.iter()
         .map(|field| Ok::<_,LLE>((field.to_owned(), n()?.to_owned())))
         .collect::<Result<_,_>>()?;
       let desc = remain.to_owned();
-      o.push(FileData{ item_spec, r_file_spec: (), extra_fields, desc });
+      o.push(FileData{ item_spec, r_file_spec, extra_fields, desc });
     }
     Ok(FileList(o))
   }