chore: Rust 1.86.0 linting

This commit is contained in:
Jack Wills
2025-04-14 11:47:00 +00:00
parent 997eebca20
commit 9acf60334c
8 changed files with 23 additions and 21 deletions
+3 -3
View File
@@ -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<ListItem<'static>> {
@@ -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
}
}
+10 -8
View File
@@ -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(
+1 -1
View File
@@ -322,7 +322,7 @@ impl DockerData {
self.config.show_std_err,
)));
}
};
}
self.update_all_container_stats();
self.app_data.lock().sort_containers();
}
+1 -1
View File
@@ -330,7 +330,7 @@ impl ExecMode {
if byte_sequence_valid(&bytes) {
waiting_thread.store(false, std::sync::atomic::Ordering::SeqCst);
}
};
}
}
});
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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)
}
+1 -1
View File
@@ -282,7 +282,7 @@ impl GuiState {
Region::HelpPanel => {
self.intersect_help = Some(area);
}
};
}
}
/// Check if an ContainerId is set in the delete_container field
+2 -2
View File
@@ -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();