mirror of
https://github.com/rust-embedded/embedded-hal.git
synced 2025-10-02 07:10:30 +00:00
Merge #328
328: Implement Error traits for Infallible r=ryankurte a=jannic Co-authored-by: Jan Niehusmann <jan@gondor.com>
This commit is contained in:
commit
a0bd3dc56a
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user