From: Ian Jackson Date: Sat, 22 May 2021 17:39:59 +0000 (+0100) Subject: shapelib: Parse the r_file_spec into the Filedata X-Git-Tag: otter-0.6.0~73 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3fae97e6cb8ed1c406875afeb46a0af50242e730;p=otter.git shapelib: Parse the r_file_spec into the Filedata Nothing uses this yet. We're going to use it for bundle shapes. Signed-off-by: Ian Jackson --- diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index 9b9922eb..a9464130 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -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, diff --git a/src/shapelib.rs b/src/shapelib.rs index a2d166c1..87249a7f 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -1094,12 +1094,12 @@ impl TryFrom 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::>()?; 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)) }