-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 'POINT EMPTY' conversion to geo_types #64
Conversation
+ support in Geometry<T> + support in deserialize_point
It seems to have been broken from earlier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Thanks for taking this one!
I see one failing test when I run locally:
failures:
---- conversion::tests::convert_empty_point stdout ----
thread 'conversion::tests::convert_empty_point' panicked at 'assertion failed: res.is_err()', src/conversion.rs:370:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
conversion::tests::convert_empty_point
test result: FAILED. 60 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s
Geometry::Point(g) => geo_types::Geometry::Point(g.try_into()?), | ||
Geometry::Point(g) => { | ||
// Special case as `geo::Point` can't be empty | ||
if g.0.is_some() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor thing, but we should be able to write this in an infallible way, like:
if let Some(c) = g.0 {
geo_types::Geometry::Point(geo_types::Point(c.into()))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to allow any other error handling / extensions we might add in the future here.
Good catch! I overlooked this test. |
bors r+ |
Build succeeded: |
CHANGES.md
if knowledge of this change could be valuable to users.closes #61