-
Notifications
You must be signed in to change notification settings - Fork 58
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 KIND contant to Interface trait #169
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.
LGTM!
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.
Hmm actually thinking about this, I wonder if forcing panic is the wrong call here. I think I'd sleep better if we Model::init
errored out properly in this case.
I'm not sure how to best approach that given how Interface::Error
is currently generic. My main concern is that kernels can have basic expectations such as "drivers do not panic" and I think that should be upheld, even in init code.
I don't think that this would have been an issue, because the compiler would have been able to resolve the assertions at compile time and remove them from the final binary. I've changed the code to return a If you are concerned about possible panics we should also look at |
Agreed, I'll make an issue for that |
This PR adds the interface kind constant to the
Interface
trait as discussed in #167.I've decided to not extend the
InitError
enum and just panic instead. It should only be possible to encounter this error during development time, when the programmer wasn't aware that the combination of controller model, color format, and interface kind isn't supported.