-
Notifications
You must be signed in to change notification settings - Fork 44
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
Allow to user chose chrono vs time #65
Conversation
304564e
to
9524687
Compare
With features being additive in theory, I'm not too fond of the idea of a I'd also slightly prefer using the formatting or parsing functions in the tests to avoid pulling in a proc macro. Let's see what the other reviewers think. |
I add feature because if we switch from chrono to time we must bump version to 0.9. This is because we have chrono in public interface. |
9524687
to
81181e8
Compare
Rewrite test without macro |
r? @urschrei |
@@ -6,6 +6,7 @@ use thiserror::Error; | |||
pub(crate) type GpxResult<T> = Result<T, GpxError>; | |||
|
|||
#[derive(Error, Debug)] | |||
#[non_exhaustive] |
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.
FWIW, this is also a breaking change (code that used to match on GpxError
will no longer compile).
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.
Yep.. I don't know what to do with this. Adding to enum also breaking change. If some one match all case
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'm curious why you made this non_exhaustive?
Is it to avoid breaking changes in the future? I could see why that would make sense for a public error type like this.
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.
Yes this can avoid breaking changes in the future
One thing to note re: breaking changes is that |
So we can bump to 0.9 and remove chrono? |
Disclaimer: I don't actively use this crate, so this is non-blocking feedback. It's kind of unfortunate to see so many Though alternatively, would it be better to use our own internal Time type and offer Into/From impls for the |
We could; I'm not against it, but as @michaelkirk also noted, I'm not a direct user of the crate. We just maintain it as best we can. Please note that there are some strings attached: if you change and bump, please help us to field questions / do some maintenance if it's required 🙂
If this isn't a huge headache and avoids a breaking change, it's the better option. |
I'm also not against removing chrono support if people think it's reasonable. Defining an internal type would still be a breaking change here, but might (might) avoid a breaking change in the future when people decide that now the I leave it to whoever is doing the work to decide. =) |
We could use |
Rework to internal Time type with From/Into conversion. If we decide to use that approach I can squash commit |
4a4486d
to
db3ff5e
Compare
bors try |
tryBuild failed: |
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.
This fails without the time
feature.
@@ -6,6 +6,7 @@ use thiserror::Error; | |||
pub(crate) type GpxResult<T> = Result<T, GpxError>; | |||
|
|||
#[derive(Error, Debug)] | |||
#[non_exhaustive] |
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'm curious why you made this non_exhaustive?
Is it to avoid breaking changes in the future? I could see why that would make sense for a public error type like this.
db3ff5e
to
a5a0f21
Compare
Fix optional time crate |
I'm seeing test failures:
Can you verify that you can run the tests? |
a5a0f21
to
06b15e5
Compare
Forgot to implement serde derives for time. |
bors r+ |
Merge conflict. |
06b15e5
to
7ea984d
Compare
Fix merge conflict and update changelog |
bors retry |
65: Allow to user chose chrono vs time r=michaelkirk a=a1ien - [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 `CHANGELOG.md` if knowledge of this change could be valuable to users. --- Co-authored-by: Ilya Averyanov <averyanovin@gmail.com>
Build failed: |
Looks like the time crate requires a newer version of rust. I'm ok with updating the minimum supported rust version, but it's nice to know what it is. Do you know what the minimum supported rust version is after this PR? |
For current version time 0.3.5 MSRV is 1.5.1 for new unreleased it's 1.53 |
bors retry |
Build succeeded: |
CHANGELOG.md
if knowledge of this change could be valuable to users.