display views: return error instead of unwrapping

This commit was merged in pull request #49.
This commit is contained in:
2026-08-29 21:09:09 +00:00
parent ef10eec216
commit 153acffb86
9 changed files with 114 additions and 40 deletions
+6 -2
View File
@@ -1,6 +1,7 @@
use crate::drivers::primary_lcd::PrimaryDisplayError;
use crate::peripherals::Peripherals;
use alloc::boxed::Box;
use core::error;
use crate::peripherals::Peripherals;
use core::future;
use alloc::vec::Vec;
@@ -31,7 +32,10 @@ impl Navigable for JournalView {
_: &Peripherals,
) -> impl core::future::Future<Output = Result<(), Box<dyn error::Error>>> + Send {
async move {
outputs.primary_display.clear(Rgb565::BLACK).unwrap();
outputs
.primary_display
.clear(Rgb565::BLACK)
.map_err(PrimaryDisplayError::from)?;
Ok(())
}
}