georust / geojson

Library for serializing the GeoJSON vector GIS file format
https://crates.io/crates/geojson
Apache License 2.0
272 stars 59 forks source link

Gracefully handle case where Feature is passed to FeatureIterator #195

Open frewsxcv opened 2 years ago

frewsxcv commented 2 years ago

See https://github.com/georust/geojson/compare/frewsxcv-test-test?expand=1

This test fails with:

called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: Error("invalid type: floating point `1`, expected a map", line: 1, column: 4) }
frewsxcv commented 2 years ago

This should either return a better error, or we should gracefully handle cases where the user passes in something that isn't a feature collection