328: Implement Error traits for Infallible r=ryankurte a=jannic



Co-authored-by: Jan Niehusmann <jan@gondor.com>
This commit is contained in:
bors[bot] 2021-11-20 20:56:11 +00:00 committed by GitHub
commit a0bd3dc56a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 0 deletions

View File

@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- `Error` traits for Can, SPI, I2C and Serial are implemented for Infallible
## [v1.0.0-alpha.6] - 2021-11-19

View File

@ -58,6 +58,12 @@ pub trait Error: core::fmt::Debug {
fn kind(&self) -> ErrorKind;
}
impl Error for core::convert::Infallible {
fn kind(&self) -> ErrorKind {
match *self {}
}
}
/// CAN error kind
///
/// This represents a common set of CAN operation errors. HAL implementations are

View File

@ -107,6 +107,12 @@ pub trait Error: core::fmt::Debug {
fn kind(&self) -> ErrorKind;
}
impl Error for core::convert::Infallible {
fn kind(&self) -> ErrorKind {
match *self {}
}
}
/// I2C error kind
///
/// This represents a common set of I2C operation errors. HAL implementations are

View File

@ -13,6 +13,12 @@ pub trait Error: core::fmt::Debug {
fn kind(&self) -> ErrorKind;
}
impl Error for core::convert::Infallible {
fn kind(&self) -> ErrorKind {
match *self {}
}
}
/// Serial error kind
///
/// This represents a common set of serial operation errors. HAL implementations are

View File

@ -64,6 +64,12 @@ pub trait Error: core::fmt::Debug {
fn kind(&self) -> ErrorKind;
}
impl Error for core::convert::Infallible {
fn kind(&self) -> ErrorKind {
match *self {}
}
}
/// SPI error kind
///
/// This represents a common set of SPI operation errors. HAL implementations are