From 3a7e3974f55b00a0780601e2b1b0eb96e78c62b6 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Mon, 30 May 2022 01:00:45 +0000 Subject: [PATCH] refactor: cargo fmt --- src/docker_data/mod.rs | 12 ++++++------ src/input_handler/mod.rs | 14 ++++++-------- src/ui/draw_blocks.rs | 3 ++- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/docker_data/mod.rs b/src/docker_data/mod.rs index 1f0dd8b..0074d1e 100644 --- a/src/docker_data/mod.rs +++ b/src/docker_data/mod.rs @@ -146,12 +146,12 @@ impl DockerData { output .iter() .filter_map(|i| { - i.id.as_ref().map(|id| ( - i.state.as_ref().unwrap_or(&String::new()) == "running", - id.to_owned(), - )) - - + i.id.as_ref().map(|id| { + ( + i.state.as_ref().unwrap_or(&String::new()) == "running", + id.to_owned(), + ) + }) }) .collect::>() } diff --git a/src/input_handler/mod.rs b/src/input_handler/mod.rs index 5c1135e..c69f61d 100644 --- a/src/input_handler/mod.rs +++ b/src/input_handler/mod.rs @@ -99,16 +99,14 @@ impl InputHandler { } }; - let gui_state = Arc::clone(&self.gui_state); - - // If the info box sleep handle is currently being executed, as in m is pressed twice within a 4000ms window - // then cancel the first handle, as a new handle will be invoked - if let Some(info_sleep_timer) = self.info_sleep.as_ref() { - info_sleep_timer.abort(); + // If the info box sleep handle is currently being executed, as in m is pressed twice within a 4000ms window + // then cancel the first handle, as a new handle will be invoked + if let Some(info_sleep_timer) = self.info_sleep.as_ref() { + info_sleep_timer.abort(); } - // Some(self.info_sleep).as_ref().unwrap().ab - + let gui_state = Arc::clone(&self.gui_state); + // Show the info box - with "mouse capture enabled / disabled", for 4000 ms self.info_sleep = Some(tokio::spawn(async move { tokio::time::sleep(std::time::Duration::from_millis(4000)).await; gui_state.lock().reset_info_box() diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index bec51e4..0fe2370 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -460,7 +460,8 @@ pub fn draw_help_box(f: &mut Frame<'_, B>) { let description_text = format!("\n{}", DESCRIPTION); let mut help_text = String::from("\n ( tab ) or ( alt+tab ) to change panels"); - help_text.push_str("\n ( ↑ ↓ ) or ( j k ) or (PgUp PgDown) or (Home End) to change selected line"); + help_text + .push_str("\n ( ↑ ↓ ) or ( j k ) or (PgUp PgDown) or (Home End) to change selected line"); help_text.push_str("\n ( enter ) to send docker container commands"); help_text.push_str("\n ( h ) to toggle this help information"); help_text.push_str(