From a14b44d1764540a85843a0b7906374e8e8150fd3 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Tue, 6 Aug 2024 14:27:38 +0200 Subject: [PATCH] chore: remove some comments; remove unnecessary test with sleep; detail could not get stat warning --- src/cmd_runner.rs | 19 +------------------ src/config.rs | 2 +- src/ui/factories/device_row_factory.rs | 1 - src/ui/main_view.rs | 3 +-- 4 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/cmd_runner.rs b/src/cmd_runner.rs index c726439..b8faf6e 100644 --- a/src/cmd_runner.rs +++ b/src/cmd_runner.rs @@ -222,24 +222,7 @@ mod tests { use crate::profile::Profile; use crate::runner::Runner; use core::time; - use std::{collections::HashMap, path::Path, thread::sleep}; - - #[test] - fn can_run_command_and_read_env() { - let mut env = HashMap::new(); - env.insert("ENVISIONTEST".to_string(), "Lorem ipsum dolor".to_string()); - let mut runner = CmdRunner::new( - Some(env), - "bash".into(), - vec!["-c".into(), "echo \"ENVISIONTEST: $ENVISIONTEST\"".into()], - ); - runner.start(); - sleep(time::Duration::from_millis(1000)); // TODO: ugly, fix - runner.terminate(); - assert_eq!(runner.status(), RunnerStatus::Stopped(Some(0))); - let out = runner.consume_output(); - assert_eq!(out, "ENVISIONTEST: Lorem ipsum dolor\n"); - } + use std::{path::Path, thread::sleep}; #[test] fn can_save_log() { diff --git a/src/config.rs b/src/config.rs index 91d76e0..fb91051 100644 --- a/src/config.rs +++ b/src/config.rs @@ -33,7 +33,7 @@ pub struct Config { impl Default for Config { fn default() -> Self { Config { - // TODO: handle first start with no profile selected + // TODO: using an empty string here is ugly selected_profile_uuid: "".to_string(), debug_view_enabled: false, user_profiles: vec![], diff --git a/src/ui/factories/device_row_factory.rs b/src/ui/factories/device_row_factory.rs index 2024d69..5b772f0 100644 --- a/src/ui/factories/device_row_factory.rs +++ b/src/ui/factories/device_row_factory.rs @@ -86,7 +86,6 @@ impl AsyncFactoryComponent for DeviceRowModel { view! { root = adw::ActionRow { - // TODO: replace with flat button that spawns popover add_prefix: icon = >k::Image { set_icon_name: Some(self.state.icon()), }, diff --git a/src/ui/main_view.rs b/src/ui/main_view.rs index 6bf6737..49dc361 100644 --- a/src/ui/main_view.rs +++ b/src/ui/main_view.rs @@ -248,9 +248,8 @@ impl SimpleComponent for MainView { set_visible: match mount_has_nosuid(&model.selected_profile.prefix) { Ok(b) => b, Err(_) => { - // TODO: handle this error better eprintln!( - "Warning: could not get stat on path {}", + "Warning (nosuid detection): could not get stat on path {}", model.selected_profile.prefix.to_string_lossy()); false },