File tree 5 files changed +26
-0
lines changed
5 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Added
11
+ - ` Error ` traits for Can, SPI, I2C and Serial are implemented for Infallible
10
12
11
13
## [ v1.0.0-alpha.6] - 2021-11-19
12
14
Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ pub trait Error: core::fmt::Debug {
58
58
fn kind ( & self ) -> ErrorKind ;
59
59
}
60
60
61
+ impl Error for core:: convert:: Infallible {
62
+ fn kind ( & self ) -> ErrorKind {
63
+ match * self { }
64
+ }
65
+ }
66
+
61
67
/// CAN error kind
62
68
///
63
69
/// This represents a common set of CAN operation errors. HAL implementations are
Original file line number Diff line number Diff line change @@ -107,6 +107,12 @@ pub trait Error: core::fmt::Debug {
107
107
fn kind ( & self ) -> ErrorKind ;
108
108
}
109
109
110
+ impl Error for core:: convert:: Infallible {
111
+ fn kind ( & self ) -> ErrorKind {
112
+ match * self { }
113
+ }
114
+ }
115
+
110
116
/// I2C error kind
111
117
///
112
118
/// This represents a common set of I2C operation errors. HAL implementations are
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ pub trait Error: core::fmt::Debug {
13
13
fn kind ( & self ) -> ErrorKind ;
14
14
}
15
15
16
+ impl Error for core:: convert:: Infallible {
17
+ fn kind ( & self ) -> ErrorKind {
18
+ match * self { }
19
+ }
20
+ }
21
+
16
22
/// Serial error kind
17
23
///
18
24
/// This represents a common set of serial operation errors. HAL implementations are
Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ pub trait Error: core::fmt::Debug {
64
64
fn kind ( & self ) -> ErrorKind ;
65
65
}
66
66
67
+ impl Error for core:: convert:: Infallible {
68
+ fn kind ( & self ) -> ErrorKind {
69
+ match * self { }
70
+ }
71
+ }
72
+
67
73
/// SPI error kind
68
74
///
69
75
/// This represents a common set of SPI operation errors. HAL implementations are
You can’t perform that action at this time.
0 commit comments