clippy fixes
This commit was merged in pull request #52.
This commit is contained in:
+17
-19
@@ -5,8 +5,8 @@ use crate::navigation::outputs::Outputs;
|
||||
use crate::peripherals::Peripherals;
|
||||
use crate::views::view::View;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::format;
|
||||
use alloc::string::String;
|
||||
use alloc::string::ToString;
|
||||
use core::error;
|
||||
use embedded_graphics::{
|
||||
Drawable,
|
||||
@@ -57,7 +57,7 @@ impl Navigable for ErrorView {
|
||||
|
||||
let bounds = Rectangle::new(Point::new(0, 30), display_area.size);
|
||||
|
||||
TextBox::with_textbox_style(&format!("{}", self.error), bounds, style, textbox_style)
|
||||
TextBox::with_textbox_style(&self.error.to_string(), bounds, style, textbox_style)
|
||||
.draw(&mut outputs.primary_display)
|
||||
.unwrap_or_else(|error| {
|
||||
panic!(
|
||||
@@ -71,23 +71,21 @@ impl Navigable for ErrorView {
|
||||
|
||||
fn handle_input(&self, input: Action) -> impl core::future::Future<Output = NewState> + Send {
|
||||
async move {
|
||||
let Action::Button(input) = input else {
|
||||
// Skip timer inputs
|
||||
return NewState {
|
||||
view: View::Error(self.clone()),
|
||||
replace_view: true,
|
||||
redraw: false,
|
||||
};
|
||||
};
|
||||
|
||||
let new_menu = match input {
|
||||
_ => View::Error(self.clone()),
|
||||
};
|
||||
|
||||
NewState {
|
||||
replace_view: matches!(new_menu, View::FlashInfo(_)),
|
||||
view: new_menu,
|
||||
redraw: true,
|
||||
let new_menu = View::Error(self.clone());
|
||||
match input {
|
||||
Action::Button(_) => NewState {
|
||||
replace_view: matches!(new_menu, View::FlashInfo(_)),
|
||||
view: new_menu,
|
||||
redraw: true,
|
||||
},
|
||||
Action::Timer => {
|
||||
// Skip timer inputs
|
||||
NewState {
|
||||
view: new_menu,
|
||||
replace_view: true,
|
||||
redraw: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user