-
Notifications
You must be signed in to change notification settings - Fork 29
Description
I find it weird that eh1::MockError only has an Io variant for an std::io::ErrorKind. Because most embedded rust cannot use std::io in production code, the tested scenario is unlikely to ever occur. IMHO, it would make more sense to allow eh1::digital::Transaction::with_error() to accept embedded_hal::digital::ErrorKind parameter type. This should be especially useful for measuring coverage of an embedded driver lib that wraps embedded_hal::*::ErrorKind into a custom Error type.
Would it be feasible to let eh1::digital::Transaction::with_error() accept embedded_hal::digital::ErrorKind parameter type?
Caution
This would break backward compatibility downstream because MockError is a different type. Adding more variants to the MockError enum wouldn't cover code that (for example)
use embedded_hal::digital::ErrorKind as OutputPinError;
impl From<OutputPinError> for CustomError<OutputPinError> {
fn from(value: OutputPinError) -> Self {
CustomError::DigitalOutError(value)
}
}