Closed rfilmyer closed 3 years ago
Well, the issue is in both shapefile & dbase,
For their iter
methods, one takes self
the other takes &mut self
.
In shapefile iter_shapes
takes self
because the file can be itered only once because iter_shapes
does not seek to the start of the records.
In dbase the iter_records
should also take self
because it has the same behaviour but because one might want to create a TableWriter::from_reader
, if the iter_record
moves the reader then it becomes impossible to reuse the reader to create its writer without cloning.
The probable easiest way to make them work together would be to make shapfile::Reader::iter_*
thake &mut self
Hi,
I was trying to see if I could get this crate to work with the newest version of another one of your crates,
dbase
0.1.Although the API has changed I think I was able to figure out how to switch from a
dbase::Writer
to adbase::TableWriter
.Unfortunately, I seem to be stuck dealing with some ownership issues - since
dbase::Reader
isn'tIterator
anymore, I had to rewrite iter_shapes_and_records_as to return adbase::RecordIterator
, but I can't figure out how to give something ownership of thedbase::Reader
I wrote my function something like this.
Sorry if this issue was invalid but I can't figure out of this is an issue with
dbase
, or if I'm just not writing something correctly.