-
Notifications
You must be signed in to change notification settings - Fork 25
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
specific errors and try_into
for inner geo-types
#57
Conversation
39d2722
to
2ca773d
Compare
} | ||
// currently only one error type in geo-types error enum, but that seems likely to change | ||
#[allow(unreachable_patterns)] | ||
other => Error::External(Box::new(other)), |
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 thought it was worth future-proofing, so we don't have to bump WKT's minimum version of geo-types again if we add to the error enum.
This is a really big ergonomic improvement; the enum is really useful, but it's been historically awkward to work with and this removes a lot of that friction 👍👍👍 |
614: Specify the details of conversion failures in an exported error enum r=michaelkirk a=michaelkirk - [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- I came across this while trying to improve ergonomics of the WKT crate, which relies on this conversion logic. (see georust/wkt#57) I *think* this is not a breaking change (see comment inline), but would appreciate confirmation. If I'm wrong, and it indeed is a breaking change, I'd prefer to hold off on merging it for now. Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
2ca773d
to
1ea19ae
Compare
Ok - updated now that the requisite geo-type 0.7.1 has been published. Are you OK with merging this @urschrei? |
Yep, lgtm! |
bors r=urschrei Excellent thanks! |
Build succeeded: |
CHANGES.md
if knowledge of this change could be valuable to users.DRAFT: depends on georust/geo#614 being released first.
Add TryFrom for converting directly to
geo_types::Geometry
enum members.Previously it was:
This introduced two new error cases, so I've also introduced
thiserror
which solves #49FIXES #49