display views: return error instead of unwrapping
This commit was merged in pull request #49.
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user