Skip to content

Commit

Permalink
WIP: Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Barrios Romero <[email protected]>
  • Loading branch information
sjoerdsimons and eldruin authored Aug 14, 2024
1 parent e970f21 commit 8b90215
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SSD1306 monochrome OLED display.

- Updated dependencies for `embedded-hal` 1.0.0.
- Switch examples to embassy STM32 PAC which implements `embedded-hal` 1.0.0 traits.
- Add an async interface, enabled via the async feature.
- Add an asynchronous interface, enabled via the `async` feature.
- **(breaking)** Increased MSRV to 1.75.0

### Added
Expand Down
15 changes: 4 additions & 11 deletions src/mode/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@ where
/// wrapping.
async fn init(&mut self) -> Result<(), TerminalModeError> {
self.init_with_addr_mode(AddrMode::Page).await?;
self.reset_pos().await?;
Ok(())
self.reset_pos().await
}
}

Expand Down Expand Up @@ -278,9 +277,7 @@ where

// But for normal operation we manage the line wrapping
self.set_addr_mode(AddrMode::Page).await?;
self.reset_pos().await?;

Ok(())
self.reset_pos().await
}

/// Print a character to the display
Expand Down Expand Up @@ -367,9 +364,7 @@ where
self.mode.cursor = Some(Cursor::new(w, h));

// Reset cursor position
self.set_position(0, 0).await?;

Ok(())
self.set_position(0, 0).await
}

/// Advance the cursor, automatically wrapping lines and/or screens if necessary
Expand All @@ -379,9 +374,7 @@ where

cursor.advance();
let (c, r) = cursor.get_position();
self.set_position(c, r).await?;

Ok(())
self.set_position(c, r).await
}

fn ensure_cursor(&mut self) -> Result<&mut Cursor, TerminalModeError> {
Expand Down

0 comments on commit 8b90215

Please sign in to comment.