refactor: remove pointless clone()'s & variable declarations

This commit is contained in:
Jack Wills
2022-10-01 21:02:38 +00:00
parent 1dbb914387
commit 6731002ee4
7 changed files with 59 additions and 70 deletions
+4 -4
View File
@@ -104,11 +104,11 @@ async fn run_app<B: Backend + Send>(
} else {
let mut now = Instant::now();
loop {
if terminal.draw(|f| ui(f, &app_data, &gui_state)).is_err() {
return Err(AppError::Terminal);
if terminal.draw(|f| ui(f, &app_data, &gui_state)).is_err() {
return Err(AppError::Terminal);
}
// TODO could only draw if in gui mode, that way all inputs & docker commands will run, and can just trace!("{event"}) all over the place
// refactor this into own function, so can be called without drawing to the terminal
// TODO could only draw if in gui mode, that way all inputs & docker commands will run, and can just trace!("{event"}) all over the place
// refactor this into own function, so can be called without drawing to the terminal
if crossterm::event::poll(input_poll_rate).unwrap_or(false) {
if let Ok(event) = event::read() {
if let Event::Key(key) = event {