-
Notifications
You must be signed in to change notification settings - Fork 223
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
Digital v1 <-> v2 compatibility wrappers and shims #127
Digital v1 <-> v2 compatibility wrappers and shims #127
Conversation
v1 -> v2 promotion now implicit, v2 -> v1 regression must be explicit with `.into()`
r? @thejpster (rust_highfive has picked a reviewer for you, use r? to override) |
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.
Great work @ryankurte! thank you for this. I added some comments below.
Co-Authored-By: ryankurte <ryankurte@users.noreply.github.com>
Thanks for all the feedback! I think I've resolved everything proposed. |
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.
Thanks @ryankurte!
I would say the remaining items as of now are:
Debug
trait for error types- public
inner
method - maybe fewer
#[cfg(feature = "unproven")]
but this is just a small detail.
Looks ok to me, but I'd like to hear more thoughts before merging. |
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.
After addressing the two nits I just found this is okay for me. While I'm not super excited about the changes we really should get embedded-hal
into motion again.
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.
LGTM
Co-Authored-By: ryankurte <ryankurte@users.noreply.github.com>
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.
Still LGTM
@thejpster are you happy that enough time has passed for people to raise any thoughts / issues? |
bors r=japaric |
127: Digital v1 <-> v2 compatibility wrappers and shims r=japaric a=ryankurte This PR introduces implicit v1 -> v2 (forward) compatibility, and explicit wrapper types for v2 -> v1 (reverse) compatibility between digital trait versions as a final step for #95, as well as moving the deprecated v1 traits to a re-exported module for clarity. As @japaric pointed out, it is not feasible to have implicit compatibility in both directions, so it seemed reasonable to make regression explicit as it hides an `.unwrap()` on failure. @therealprof, @hannobraun, @eldruin what do you think of this approach? I think it probably needs more documentation, though I am definitely open to suggestions as to what / where. See also: #100, #92, #102. Co-authored-by: Ryan Kurte <ryankurte@gmail.com> Co-authored-by: Diego Barrios Romero <eldruin@gmail.com> Co-authored-by: Daniel Egger <daniel@eggers-club.de>
Build succeeded |
This PR introduces implicit v1 -> v2 (forward) compatibility, and explicit wrapper types for v2 -> v1 (reverse) compatibility between digital trait versions as a final step for #95, as well as moving the deprecated v1 traits to a re-exported module for clarity.
As @japaric pointed out, it is not feasible to have implicit compatibility in both directions, so it seemed reasonable to make regression explicit as it hides an
.unwrap()
on failure.@therealprof, @hannobraun, @eldruin what do you think of this approach?
I think it probably needs more documentation, though I am definitely open to suggestions as to what / where.
See also: #100, #92, #102.