chiark / gitweb /
new shapelib can read a library toml
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 16 Sep 2020 22:30:48 +0000 (23:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 16 Sep 2020 22:30:48 +0000 (23:30 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/shapelib.rs

index c22190bf6cbbe4086c0d1ad5097f3ba06266fce0..1a860d84d7bf2d485ff6aac1100c88498dd05249 100644 (file)
@@ -39,7 +39,7 @@ struct LibraryGroupSpec {
 }
 
 #[derive(Deserialize,Debug)]
-#[serde(try_from="&str")]
+#[serde(try_from="String")]
 pub struct FileList (Vec<FileEntry>);
 
 #[derive(Deserialize,Debug)]
@@ -153,10 +153,10 @@ struct Circle { }
 #[typetag::deserialize]
 impl OutlineSpec for Circle { }
 
-impl TryFrom<&str> for FileList {
+impl TryFrom<String> for FileList {
   type Error = LLE;
   #[throws(LLE)]
-  fn try_from(s: &str) -> FileList {
+  fn try_from(s: String) -> FileList {
     let mut o = Vec::new();
     for (lno,l) in s.lines().enumerate() {
       let l = l.trim();