diff --git a/create_release.sh b/create_release.sh index 594fcd7..82ec4ae 100755 --- a/create_release.sh +++ b/create_release.sh @@ -193,6 +193,7 @@ release_flow() { ask_changelog_update git checkout -b "$RELEASE_BRANCH" update_cargo_toml + cargo fmt git add . git commit -m "chore: release $NEW_TAG_VERSION" git checkout main diff --git a/src/app_data/container_state.rs b/src/app_data/container_state.rs index 084fbcb..d0c9503 100644 --- a/src/app_data/container_state.rs +++ b/src/app_data/container_state.rs @@ -232,7 +232,7 @@ impl Stats for CpuStats { impl fmt::Display for CpuStats { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let disp = format!("{:05.2}%", self.value); - write!(f, "{:>x$}", disp, x = f.width().unwrap_or(1)) + write!(f, "{:>x$}", disp, x = f.width().unwrap_or(1)) } } @@ -411,7 +411,7 @@ pub struct Columns { impl Columns { pub fn new() -> Self { Self { - // 7 to allow for 100.00% + // 7 to allow for 100.00% cpu: (String::from("cpu"), 7), image: (String::from("image"), 5), name: (String::from("name"), 4), diff --git a/src/app_data/mod.rs b/src/app_data/mod.rs index f0094b1..e6ede5e 100644 --- a/src/app_data/mod.rs +++ b/src/app_data/mod.rs @@ -31,8 +31,7 @@ impl AppData { } } - - // Current time as unix timestamp + // Current time as unix timestamp fn get_systemtime(&self) -> u64 { SystemTime::now() .duration_since(UNIX_EPOCH) @@ -40,7 +39,6 @@ impl AppData { .as_secs() } - /// Get the current select docker command /// So know which command to execute pub fn get_docker_command(&self) -> Option { @@ -363,8 +361,8 @@ impl AppData { } } - /// update logs of a given container, based on index not id - pub fn update_log_by_index(&mut self, output: Vec, index: usize) { + /// update logs of a given container, based on index not id + pub fn update_log_by_index(&mut self, output: Vec, index: usize) { let tz = self.get_systemtime(); if let Some(container) = self.containers.items.get_mut(index) { container.last_updated = tz; @@ -388,8 +386,7 @@ impl AppData { self.logs_parsed = true; } - - pub fn update_all_logs(&mut self, all_logs: Vec>) { + pub fn update_all_logs(&mut self, all_logs: Vec>) { for (index, output) in all_logs.into_iter().enumerate() { self.update_log_by_index(output, index); } diff --git a/src/input_handler/mod.rs b/src/input_handler/mod.rs index b41940a..3e14fb5 100644 --- a/src/input_handler/mod.rs +++ b/src/input_handler/mod.rs @@ -43,7 +43,7 @@ impl InputHandler { is_running, rec, }; - inner.start().await; + inner.start().await; } /// check for incoming messages @@ -129,7 +129,7 @@ impl InputHandler { } } KeyCode::Enter => { - // Does is matter though? + // Does is matter though? // This isn't great, just means you can't send docker commands before full initialization of the program // could change to to if loading = true, although at the moment don't have a loading bool let panel = self.gui_state.lock().selected_panel; diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 8bdda8d..f3ac6c9 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -222,16 +222,15 @@ pub fn draw_logs( let block = generate_block(Some(panel), app_data, selected_panel); - let init = app_data.lock().init; - if !init { - let icon = gui_state.lock().get_loading(); + let init = app_data.lock().init; + if !init { + let icon = gui_state.lock().get_loading(); let parsing_logs = format!("parsing logs {}", icon); let paragraph = Paragraph::new(parsing_logs) .style(Style::default()) .block(block) .alignment(Alignment::Center); f.render_widget(paragraph, area) - } else if let Some(index) = index { let items = app_data.lock().containers.items[index] .logs @@ -349,8 +348,8 @@ fn make_chart( .fg(label_color), ), ]) - // add 0.01, for cases when the value is 0 - .bounds([0.0, max.get_value() +0.01]), + // add 0.01, for cases when the value is 0 + .bounds([0.0, max.get_value() + 0.01]), ) } diff --git a/src/ui/gui_state.rs b/src/ui/gui_state.rs index 39e3d40..eb53924 100644 --- a/src/ui/gui_state.rs +++ b/src/ui/gui_state.rs @@ -94,9 +94,9 @@ impl SelectablePanel { /// Global gui_state, stored in an Arc #[derive(Debug)] pub struct GuiState { - // Think this should be a BMapTree, so can define order when iterating over potential intersects - // Is an issue if two panels are in the same space, sush as a smaller panel embedded, yet infront of, a larger panel - // If a BMapTree think it would mean have to implement ordering for SelectablePanel + // Think this should be a BMapTree, so can define order when iterating over potential intersects + // Is an issue if two panels are in the same space, sush as a smaller panel embedded, yet infront of, a larger panel + // If a BMapTree think it would mean have to implement ordering for SelectablePanel area_map: HashMap, loading: Loading, pub selected_panel: SelectablePanel, diff --git a/src/ui/mod.rs b/src/ui/mod.rs index a7b28f1..002175a 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -85,7 +85,7 @@ async fn run_app( } else { loop { terminal.draw(|f| ui(f, &app_data, &gui_state)).unwrap(); - if crossterm::event::poll(input_poll_rate).unwrap() { + if crossterm::event::poll(input_poll_rate).unwrap() { let event = event::read().unwrap(); if let Event::Key(key) = event { sender