Skip to content

Commit c74d321

Browse files
Thomas Kiliantherealprof
Thomas Kilian
authored andcommitted
Fix TerminalMode::write_str() to write all chars (#228)
1 parent 8e45cb2 commit c74d321

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ SSD1306 monochrome OLED display.
66
<!-- next-header -->
77

88
## [Unreleased] - ReleaseDate
9+
### Fixed
10+
- Fix TerminalMode::write_str() to write all chars ([#228](https://github.com/rust-embedded-community/ssd1306/issues/228))
11+
912
## [0.10.0] - 2025-03-22
1013
### Changed
1114
- Added `DisplaySize64x32` to the prelude

src/mode/terminal.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,8 @@ where
624624
SIZE: TerminalDisplaySize,
625625
{
626626
fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> {
627-
s.chars().map(move |c| self.print_char(c)).next_back();
628-
Ok(())
627+
s.chars()
628+
.try_for_each(|c| self.print_char(c))
629+
.map_err(|_| fmt::Error)
629630
}
630631
}

0 commit comments

Comments
 (0)