Skip to content

Commit ba6a952

Browse files
committed
refactor: dead code removed, methods renamed
1 parent 7f42383 commit ba6a952

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

src/app_error.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ use crate::app_data::DockerCommand;
22
use std::fmt;
33

44
/// app errors to set in global state
5-
#[allow(unused)]
5+
// #[allow(unused)]
66
#[derive(Debug, Clone, Copy)]
77
pub enum AppError {
88
DockerCommand(DockerCommand),
99
DockerExec,
1010
DockerLogs,
1111
DockerConnect,
12-
DockerInterval,
13-
InputPoll,
1412
MouseCapture(bool),
1513
Terminal,
1614
}
@@ -23,8 +21,6 @@ impl fmt::Display for AppError {
2321
Self::DockerExec => write!(f, "Unable to exec into container"),
2422
Self::DockerLogs => write!(f, "Unable to save logs"),
2523
Self::DockerConnect => write!(f, "Unable to access docker daemon"),
26-
Self::DockerInterval => write!(f, "Docker update interval needs to be greater than 0"),
27-
Self::InputPoll => write!(f, "Unable to poll user input"),
2824
Self::MouseCapture(x) => {
2925
let reason = if *x { "en" } else { "dis" };
3026
write!(f, "Unable to {reason}able mouse capture")

src/parse_args.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,7 @@ impl CliArgs {
6565
/// 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
6666
/// returns a bool, so that the `update_all_containers()` won't bother to check the entry point unless running via a container
6767
fn check_if_in_container() -> bool {
68-
if let Ok(value) = std::env::var(ENV_KEY) {
69-
if value == ENV_VALUE {
70-
return true;
71-
}
72-
}
73-
false
68+
std::env::var(ENV_KEY).map_or(false, |i| i == ENV_VALUE)
7469
}
7570

7671
/// Parse cli arguments

src/ui/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl Ui {
5959
}
6060

6161
/// Create a new Ui struct, and execute the drawing loop
62-
pub async fn create(
62+
pub async fn start(
6363
app_data: Arc<Mutex<AppData>>,
6464
gui_state: Arc<Mutex<GuiState>>,
6565
input_tx: Sender<InputMessages>,

0 commit comments

Comments
 (0)