Skip to content

Commit

Permalink
Streamline error type parameter name
Browse files Browse the repository at this point in the history
It's about the error and not the I2C implementation type.
  • Loading branch information
sirhcel committed Nov 20, 2024
1 parent 53dce01 commit 72f8f3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ pub enum Error<E> {
Crc,
}

impl<I> From<i2c::Error<I>> for Error<I::Error>
impl<E> From<i2c::Error<E>> for Error<E::Error>
where
I: embedded_hal::i2c::ErrorType,
E: embedded_hal::i2c::ErrorType,
{
fn from(err: i2c::Error<I>) -> Self {
fn from(err: i2c::Error<E>) -> Self {
match err {
i2c::Error::Crc => Error::Crc,
i2c::Error::I2cRead(e) => Error::I2c(e),
Expand Down

0 comments on commit 72f8f3f

Please sign in to comment.