-
Notifications
You must be signed in to change notification settings - Fork 474
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
Replace From implementation of SwapInterval that could panic with TryFrom #1413
base: master
Are you sure you want to change the base?
Conversation
Doesn't seem a very useful breaking change to remove the From, although there is value is adding TryFrom. Could you please re-add From to call TryFrom? |
I can't, (see first comment), all |
0119b60
to
51451e4
Compare
I see, so we can only do that when trait impl specialization is in stable. I think for now we could just add something that acts like try_from but doesn't use the trait TryFrom to avoid conflict, and then when it stabilized without breaking anything we can impl try_from directly. |
This can take a while, and I don't expect that this will be specializable, because that would allow different logic for
We can add an inherent function The simplest way is 'just do a breaking change', it can be argued how many people use |
I would prefer that. I know it's extremely minor but personally I hate when I update a library with a breaking change and it didn't even leave me 1 version of leeway to migrate to a new version using deprecation. Plus, I really doubt that the trait |
dba99f0
to
b2f24d1
Compare
Apparently you can't deprecate a trait implementation in Rust, so I added a |
Println in the console is really dirty, I would rather have nothing at runtime and just leave it as-is, but put the deprecation notice in a doc comment |
…d a println Notes: - Trait implementations can't be deprecated, so had to use some other way. - try_from is now an inherent function because From and TryFrom can't be implemented at the same time.
e3136b8
to
8212893
Compare
Rebased this one and my 2 other PRs |
fixes #1311
Unfortunately this is a breaking change, Rust automatically implements
TryFrom
for types that implementFrom
, so just adding theTryFrom
implementation will not work.