Skip to content

Commit

Permalink
refactor: dead code removed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Dec 5, 2024
1 parent 9c4f891 commit caf23be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/app_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::app_data::DockerCommand;
use std::fmt;

/// app errors to set in global state
// #[allow(unused)]
#[derive(Debug, Clone, Copy)]
pub enum AppError {
DockerCommand(DockerCommand),
Expand Down
15 changes: 9 additions & 6 deletions src/docker_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ impl DockerData {
(None, None)
};

let mem_limit = stats.memory_stats.limit.unwrap_or_default();

let op_key = stats
.networks
.as_ref()
Expand All @@ -166,9 +164,14 @@ impl DockerData {
(0, 0)
};

app_data
.lock()
.update_stats_by_id(id, cpu_stats, mem_stat, mem_limit, rx, tx);
app_data.lock().update_stats_by_id(
id,
cpu_stats,
mem_stat,
stats.memory_stats.limit.unwrap_or_default(),
rx,
tx,
);
}
spawns.lock().remove(&spawn_id);
}
Expand Down Expand Up @@ -306,7 +309,7 @@ impl DockerData {
if let Some(container) = self.app_data.lock().get_selected_container() {
let last_updated = container.last_updated;
let spawn_id = SpawnId::Log(container.id.clone());
// Only spawn if not already sapwned with a given id/binate pair
// Only spawn if not already spawned with a given id/binate pair
if let std::collections::hash_map::Entry::Vacant(spawns) =
self.spawns.lock().entry(spawn_id)
{
Expand Down

0 comments on commit caf23be

Please sign in to comment.