chore: Rust 1.83 linting

This commit is contained in:
Jack Wills
2024-11-28 14:27:47 +00:00
parent 5ee48d5708
commit 751d997a3d
3 changed files with 5 additions and 12 deletions
-8
View File
@@ -160,7 +160,6 @@ impl AppData {
}
/// Filter related methods
/// Get the current filter term
pub const fn get_filter_term(&self) -> Option<&String> {
self.filter.term.as_ref()
@@ -280,7 +279,6 @@ impl AppData {
}
/// Container sort related methods
/// Change the sorted order, also set the selected container state to match new order
fn set_sorted(&mut self, x: Option<(Header, SortedOrder)>) {
self.sorted_by = x;
@@ -390,7 +388,6 @@ impl AppData {
}
/// Container state methods
/// Get the total number of none "hidden" containers
pub fn get_container_len(&self) -> usize {
self.containers.items.len()
@@ -530,7 +527,6 @@ impl AppData {
}
/// Selected DockerCommand methods
/// Get the current selected docker command
/// So know which command to execute
pub fn selected_docker_controls(&self) -> Option<DockerCommand> {
@@ -585,7 +581,6 @@ impl AppData {
}
/// Logs related methods
/// Get the title for log panel for selected container, will be either
/// 1) "logs x/x - container_name - container_image"
/// 2) "logs - container_name - container_image" when no logs found
@@ -650,7 +645,6 @@ impl AppData {
}
/// Chart data related methods
/// Get mutable Option of the currently selected container chart data
pub fn get_chart_data(&mut self) -> Option<(CpuTuple, MemTuple)> {
self.containers
@@ -661,7 +655,6 @@ impl AppData {
}
/// Error related methods
/// Get single app_state error
pub const fn get_error(&self) -> Option<AppError> {
self.error
@@ -726,7 +719,6 @@ impl AppData {
}
/// Update related methods
/// Get mutable reference to a container in the containers vec & the hidden_containers vec
fn get_any_container_by_id(&mut self, id: &ContainerId) -> Option<&mut ContainerItem> {
if self.get_hidden_container_by_id(id).is_some() {
+4 -3
View File
@@ -277,15 +277,16 @@ impl DockerData {
}
/// Update all logs, spawn each container into own tokio::spawn thread
fn init_all_logs(&self, all_ids: &[(State, ContainerId)], init: &Option<Arc<AtomicUsize>>) {
fn init_all_logs(&self, all_ids: &[(State, ContainerId)], init: Option<&Arc<AtomicUsize>>) {
for (_, id) in all_ids {
// let init = init.map(|i|Arc::clone(i));
self.spawns.lock().insert(
SpawnId::Log(id.clone()),
tokio::spawn(Self::update_log(
Arc::clone(&self.app_data),
Arc::clone(&self.docker),
id.clone(),
init.clone(),
init.map(Arc::clone),
0,
Arc::clone(&self.spawns),
)),
@@ -303,7 +304,7 @@ impl DockerData {
self.update_all_container_stats(&all_ids);
let init = Arc::new(AtomicUsize::new(0));
self.init_all_logs(&all_ids, &Some(Arc::clone(&init)));
self.init_all_logs(&all_ids, Some(&init));
while init.load(std::sync::atomic::Ordering::SeqCst) != all_ids.len() {
self.app_data.lock().sort_containers();