From 1d1b42516fc48aa6de788ee8962d1a2ccc8c86be Mon Sep 17 00:00:00 2001 From: Daniel Boll Date: Mon, 30 Oct 2023 10:04:16 -0300 Subject: [PATCH 1/3] refactor(draw_blocks.rs): remove unnecessary .as_ref() calls on constraints method to improve code readability refactor(mod.rs): remove unnecessary .as_ref() calls on constraints method to improve code readability --- src/ui/draw_blocks.rs | 14 +++++++------- src/ui/mod.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 4080966..874fdda 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -25,13 +25,13 @@ use super::gui_state::{BoxLocation, DeleteButton, Region}; use super::{GuiState, SelectablePanel}; const NAME_TEXT: &str = r#" - 88 - 88 - 88 + 88 + 88 + 88 ,adPPYba, 8b, ,d8 88 ,d8 ,adPPYba, 8b,dPPYba, a8" "8a `Y8, ,8P' 88 ,a8" a8P_____88 88P' "Y8 -8b d8 )888( 8888[ 8PP""""""" 88 -"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 +8b d8 )888( 8888[ 8PP""""""" 88 +"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 `"YbbdP"' 8P' `Y8 88 `Y8a `"Ybbd8"' 88 "#; const NAME: &str = env!("CARGO_PKG_NAME"); @@ -445,7 +445,7 @@ pub fn heading_bar( let split_bar = Layout::default() .direction(Direction::Horizontal) - .constraints(splits.as_ref()) + .constraints(splits) .split(area); if has_containers { // Draw loading icon, or not, and a prefix with a single space @@ -458,7 +458,7 @@ pub fn heading_bar( let container_splits = header_data.iter().map(|i| i.2).collect::>(); let headers_section = Layout::default() .direction(Direction::Horizontal) - .constraints(container_splits.as_ref()) + .constraints(container_splits) .split(split_bar[1]); // draw the actual header blocks diff --git a/src/ui/mod.rs b/src/ui/mod.rs index c8b8da6..8ec882b 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -250,7 +250,7 @@ fn draw_frame( // Containers + docker commands let top_panel = Layout::default() .direction(Direction::Horizontal) - .constraints(top_split.as_ref()) + .constraints(top_split) .split(upper_main[0]); let lower_split = if has_containers { @@ -262,7 +262,7 @@ fn draw_frame( // Split into 2, logs, and optional charts let lower_main = Layout::default() .direction(Direction::Vertical) - .constraints(lower_split.as_ref()) + .constraints(lower_split) .split(upper_main[1]); draw_blocks::containers(app_data, top_panel[0], f, gui_state, &column_widths); From 67770a10588005ce8342b7e26e1ee7be399df8e3 Mon Sep 17 00:00:00 2001 From: Daniel Boll Date: Tue, 31 Oct 2023 11:55:06 -0300 Subject: [PATCH 2/3] chore(draw_blocks.rs): format code using rustfmt to improve code readability chore(draw_blocks.rs): remove unnecessary indentation in NAME_TEXT constant to improve code readability --- src/ui/draw_blocks.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 874fdda..3172c4d 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -24,14 +24,15 @@ use crate::{ use super::gui_state::{BoxLocation, DeleteButton, Region}; use super::{GuiState, SelectablePanel}; +#[rustfmt::skip] const NAME_TEXT: &str = r#" - 88 - 88 - 88 + 88 + 88 + 88 ,adPPYba, 8b, ,d8 88 ,d8 ,adPPYba, 8b,dPPYba, a8" "8a `Y8, ,8P' 88 ,a8" a8P_____88 88P' "Y8 -8b d8 )888( 8888[ 8PP""""""" 88 -"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 +8b d8 )888( 8888[ 8PP""""""" 88 +"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 `"YbbdP"' 8P' `Y8 88 `Y8a `"Ybbd8"' 88 "#; const NAME: &str = env!("CARGO_PKG_NAME"); From 2c22ab4c57f1943b66fea3ee2cbdad1fc02b88d2 Mon Sep 17 00:00:00 2001 From: Daniel Boll Date: Tue, 31 Oct 2023 14:07:48 -0300 Subject: [PATCH 3/3] chore(draw_blocks.rs): remove unnecessary fmt skip directive Signed-off-by: Daniel Boll --- src/ui/draw_blocks.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 3172c4d..9bba583 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -24,7 +24,6 @@ use crate::{ use super::gui_state::{BoxLocation, DeleteButton, Region}; use super::{GuiState, SelectablePanel}; -#[rustfmt::skip] const NAME_TEXT: &str = r#" 88 88