diff --git a/src/app_data/container_state.rs b/src/app_data/container_state.rs index d1d3786..fd00eaf 100644 --- a/src/app_data/container_state.rs +++ b/src/app_data/container_state.rs @@ -481,7 +481,7 @@ impl ByteStats { pub const fn new(value: u64) -> Self { Self(value) } - pub fn update(&mut self, value: u64) { + pub const fn update(&mut self, value: u64) { self.0 = value; } } @@ -567,7 +567,7 @@ impl Logs { pub fn insert(&mut self, line: ListItem<'static>, tz: LogsTz) { if self.tz.insert(tz) { self.logs.items.push(line); - }; + } } pub fn to_vec(&self) -> Vec> { @@ -598,7 +598,7 @@ impl Logs { self.logs.items.len() } - pub fn state(&mut self) -> &mut ListState { + pub const fn state(&mut self) -> &mut ListState { &mut self.logs.state } } diff --git a/src/app_data/mod.rs b/src/app_data/mod.rs index b852d33..cb4558c 100644 --- a/src/app_data/mod.rs +++ b/src/app_data/mod.rs @@ -237,7 +237,7 @@ impl AppData { term.push(c); } else { self.filter.term = Some(format!("{c}")); - }; + } self.filter_containers(); } @@ -275,7 +275,7 @@ impl AppData { while let Some(i) = self.hidden_containers.pop() { if self.get_container_by_id(&i.id).is_none() { self.containers.items.push(i); - }; + } } self.sort_containers(); } @@ -420,6 +420,8 @@ impl AppData { } /// Get all the ContainerItems + /// Thnk this allow block can be removed with the 1.87 release of Clippy + #[allow(clippy::missing_const_for_fn)] pub fn get_container_items(&self) -> &[ContainerItem] { &self.containers.items } @@ -459,7 +461,7 @@ impl AppData { } /// Get ListState of containers - pub fn get_container_state(&mut self) -> &mut ListState { + pub const fn get_container_state(&mut self) -> &mut ListState { &mut self.containers.state } @@ -886,10 +888,10 @@ impl AppData { if let Some(item) = self.get_any_container_by_id(&id) { if item.name.get() != name { item.name.set(name); - }; + } if item.status != status { item.status = status; - }; + } if item.state != state { item.docker_controls.items = DockerCommand::gen_vec(state); // Update the list state, needs to be None if the gen_vec returns an empty vec @@ -898,15 +900,15 @@ impl AppData { item.docker_controls.state.select(None); } _ => item.docker_controls.start(), - }; + } item.state = state; - }; + } item.ports = ports; if item.image.get() != image { item.image.set(image); - }; + } } else { // container not known, so make new ContainerItem and push into containers Ve let container = ContainerItem::new( diff --git a/src/docker_data/mod.rs b/src/docker_data/mod.rs index 2295b83..499a647 100644 --- a/src/docker_data/mod.rs +++ b/src/docker_data/mod.rs @@ -322,7 +322,7 @@ impl DockerData { self.config.show_std_err, ))); } - }; + } self.update_all_container_stats(); self.app_data.lock().sort_containers(); } diff --git a/src/exec.rs b/src/exec.rs index 0a49edd..a1604b4 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -330,7 +330,7 @@ impl ExecMode { if byte_sequence_valid(&bytes) { waiting_thread.store(false, std::sync::atomic::Ordering::SeqCst); } - }; + } } }); diff --git a/src/input_handler/mod.rs b/src/input_handler/mod.rs index 7ba06b0..a52c8dd 100644 --- a/src/input_handler/mod.rs +++ b/src/input_handler/mod.rs @@ -167,7 +167,7 @@ impl InputHandler { .set_info_box("✓ mouse capture enabled"); } else { err(); - }; + } self.mouse_capture = !self.mouse_capture; } @@ -264,7 +264,7 @@ impl InputHandler { // Poor way of disallowing commands to be sent to a containerised okxer if self.app_data.lock().is_oxker_in_container() { return; - }; + } let option_id = self.app_data.lock().get_selected_container_id(); if let Some(id) = option_id { match command { @@ -639,7 +639,7 @@ impl InputHandler { SelectablePanel::Containers => self.app_data.lock().containers_next(), SelectablePanel::Logs => self.app_data.lock().log_next(), SelectablePanel::Commands => self.app_data.lock().docker_controls_next(), - }; + } } /// Change state to previous, depending which panel is currently in focus diff --git a/src/ui/draw_blocks/headers.rs b/src/ui/draw_blocks/headers.rs index 33ec2f3..5134bf0 100644 --- a/src/ui/draw_blocks/headers.rs +++ b/src/ui/draw_blocks/headers.rs @@ -46,8 +46,8 @@ fn gen_header_block<'a>(colors: AppColors, fd: &FrameData, header: Header) -> (C SortedOrder::Desc => suffix = " ▼", } color = colors.headers_bar.text_selected; - }; - }; + } + } (color, suffix) } diff --git a/src/ui/gui_state.rs b/src/ui/gui_state.rs index 40d9aa7..0c9d57a 100644 --- a/src/ui/gui_state.rs +++ b/src/ui/gui_state.rs @@ -282,7 +282,7 @@ impl GuiState { Region::HelpPanel => { self.intersect_help = Some(area); } - }; + } } /// Check if an ContainerId is set in the delete_container field diff --git a/src/ui/mod.rs b/src/ui/mod.rs index c017e51..cc64199 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -93,7 +93,7 @@ impl Ui { } if let Err(e) = ui.reset_terminal() { error!("{e}"); - }; + } } _ => { error!("Terminal Error"); @@ -180,7 +180,7 @@ impl Ui { self.app_data .lock() .set_error(e, &self.gui_state, Status::Error); - }; + } } self.terminal.clear().ok(); self.reset_terminal().ok();