-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add error propagation from the embedded_hal
functions
#37
Add error propagation from the embedded_hal
functions
#37
Conversation
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.
thank you for your contribution!
some requests from my side (besides the comments in the code):
- please split this into atomic commits (and possibly atomic PRs; i'm still a bit on the fence about the last point)
- one for the error propagation
- one for
Backwards
=>Backward
(thanks for catching that!) - one for removing the APIs
- please use proper commit messages (also mentioned in the Git Book)
While in future I will try to note your preference for atomic commits (apologies I forgot since last time you asked), I think it would be not worth the effort for me to split this into multiple commits as I'd have to re-do everything from scratch again. I don't think its generally a great idea to expect open-source contributors (particularly new contributors) to stick to such a commit-schema as it may discourage committers without enough know-how of |
i think it's important to (try to) uphold the standards also (and especially) in open source projects, both to make them maintainable & understandable in the long-term but also to teach people the best practices. for this specific PR i think it's fine if you squash the commits together and provide a nice commit message (you can go with a generic "refactor: streamline API and expose errors through i think i'm ok with removing the duplicate methods. for the |
ffd1778
to
71c128b
Compare
@ripytide: sorry for the long delay here! rust-embedded/embedded-hal#576 has been discussed in the last rust-embedded meeting (see the meeting minutes) and the approach chosen here is considered best practices for could you please:
with that i can then ACK & merge it and we can get your other PR in as well and finally release this thing! |
Also: - renamed error types to their struct names - renamed DriveCommand::Backwards to DriveCommand::Backward to match DriveCommand::Forward - removed the `drive_forward`, `drive_backward`, `stop` and `brake` functions as they are duplicates to the `drive` function with the different enum variants and make the API surface larger - cleaned up the changelog
8445cf8
to
7612d79
Compare
@rursprung I have rebased and squashed the PR |
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 a lot for this!
Also I though it might be nice to reduce the API surface by removing the
drive_forward
,drive_backward
,stop
andbrake
functions which make the library harder to maintain and also adds confusing redundancy as it leaves two ways of accomplishing the same thing,drive()
vs the other commands.I also renamed
DriveCommand::Backwards
toDriveCommand::Backward
to match the non-pluralDriveCommand::Forward
command.