Skip to content

Commit

Permalink
refactor: dead code removed, methods renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Nov 18, 2024
1 parent 7f42383 commit ba6a952
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/app_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ use crate::app_data::DockerCommand;
use std::fmt;

/// app errors to set in global state
#[allow(unused)]
// #[allow(unused)]
#[derive(Debug, Clone, Copy)]
pub enum AppError {
DockerCommand(DockerCommand),
DockerExec,
DockerLogs,
DockerConnect,
DockerInterval,
InputPoll,
MouseCapture(bool),
Terminal,
}
Expand All @@ -23,8 +21,6 @@ impl fmt::Display for AppError {
Self::DockerExec => write!(f, "Unable to exec into container"),
Self::DockerLogs => write!(f, "Unable to save logs"),
Self::DockerConnect => write!(f, "Unable to access docker daemon"),
Self::DockerInterval => write!(f, "Docker update interval needs to be greater than 0"),
Self::InputPoll => write!(f, "Unable to poll user input"),
Self::MouseCapture(x) => {
let reason = if *x { "en" } else { "dis" };
write!(f, "Unable to {reason}able mouse capture")
Expand Down
7 changes: 1 addition & 6 deletions src/parse_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ impl CliArgs {
/// An ENV is set in the ./containerised/Dockerfile, if this is ENV found, then sleep for 250ms, else the container, for as yet unknown reasons, will close immediately
/// returns a bool, so that the `update_all_containers()` won't bother to check the entry point unless running via a container
fn check_if_in_container() -> bool {
if let Ok(value) = std::env::var(ENV_KEY) {
if value == ENV_VALUE {
return true;
}
}
false
std::env::var(ENV_KEY).map_or(false, |i| i == ENV_VALUE)
}

/// Parse cli arguments
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Ui {
}

/// Create a new Ui struct, and execute the drawing loop
pub async fn create(
pub async fn start(
app_data: Arc<Mutex<AppData>>,
gui_state: Arc<Mutex<GuiState>>,
input_tx: Sender<InputMessages>,
Expand Down

0 comments on commit ba6a952

Please # to comment.