File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
15
15
16
16
- Updated to stm32-rs v0.6.0 - @HarkonenBade
17
17
- Updated the ADC code to use variants added in stm32-rs v0.6.0 - @HarkonenBade
18
+ - Improved serial ` write_str ` implementation
18
19
19
20
## [ v0.12.0] - 2019-01-13
20
21
Original file line number Diff line number Diff line change @@ -518,10 +518,10 @@ where
518
518
Tx < USART > : embedded_hal:: serial:: Write < u8 > ,
519
519
{
520
520
fn write_str ( & mut self , s : & str ) -> Result {
521
- use nb :: block ;
522
-
523
- let _ = s . as_bytes ( ) . iter ( ) . map ( |c| block ! ( self . write( * c) ) ) . last ( ) ;
524
- Ok ( ( ) )
521
+ s . as_bytes ( )
522
+ . iter ( )
523
+ . try_for_each ( |c| nb :: block!( self . write( * c) ) )
524
+ . map_err ( |_| core :: fmt :: Error )
525
525
}
526
526
}
527
527
@@ -531,10 +531,10 @@ where
531
531
TXPIN : TxPin < USART > ,
532
532
{
533
533
fn write_str ( & mut self , s : & str ) -> Result {
534
- use nb :: block ;
535
-
536
- let _ = s . as_bytes ( ) . iter ( ) . map ( |c| block ! ( self . write( * c) ) ) . last ( ) ;
537
- Ok ( ( ) )
534
+ s . as_bytes ( )
535
+ . iter ( )
536
+ . try_for_each ( |c| nb :: block!( self . write( * c) ) )
537
+ . map_err ( |_| core :: fmt :: Error )
538
538
}
539
539
}
540
540
You can’t perform that action at this time.
0 commit comments