File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -492,6 +492,24 @@ pub enum Error {
492
492
BufferNotInRAM ,
493
493
}
494
494
495
+ impl fmt:: Display for Error {
496
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
497
+ use Error :: * ;
498
+ match self {
499
+ TxBufferTooSmall => writeln ! ( f, "tx buffer too small" ) ,
500
+ RxBufferTooSmall => writeln ! ( f, "rx buffer too small" ) ,
501
+ TxBufferTooLong => writeln ! ( f, "tx buffer too long" ) ,
502
+ RxBufferTooLong => writeln ! ( f, "rx buffer too long" ) ,
503
+ Transmit => writeln ! ( f, "transmit error" ) ,
504
+ Receive => writeln ! ( f, "receive error" ) ,
505
+ Timeout ( t) => writeln ! ( f, "timeout ({})" , t) ,
506
+ BufferNotInRAM => writeln ! ( f, "buffer not in ram" ) ,
507
+ }
508
+ }
509
+ }
510
+
511
+ impl core:: error:: Error for Error { }
512
+
495
513
impl embedded_io:: Error for Error {
496
514
fn kind ( & self ) -> ErrorKind {
497
515
match self {
You can’t perform that action at this time.
0 commit comments