Skip to content

Commit

Permalink
chore: Rust 1.83 linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Nov 28, 2024
1 parent 5ee48d5 commit 751d997
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
8 changes: 0 additions & 8 deletions src/app_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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> {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -661,7 +655,6 @@ impl AppData {
}

/// Error related methods
/// Get single app_state error
pub const fn get_error(&self) -> Option<AppError> {
self.error
Expand Down Expand Up @@ -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() {
Expand Down
7 changes: 4 additions & 3 deletions src/docker_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)),
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/draw_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ pub fn error(f: &mut Frame, error: AppError, seconds: Option<u8>) {

let area = popup(lines, max_line_width, f.area(), BoxLocation::MiddleCentre);

f.render_widget(Clear, area);
f.render_widget(Clear, area);
f.render_widget(paragraph, area);
}

Expand Down

0 comments on commit 751d997

Please # to comment.