summaryrefslogtreecommitdiffstats
path: root/src/modes/edit/removable_devices.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/edit/removable_devices.rs')
-rw-r--r--src/modes/edit/removable_devices.rs23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/modes/edit/removable_devices.rs b/src/modes/edit/removable_devices.rs
index 13917bd..1625576 100644
--- a/src/modes/edit/removable_devices.rs
+++ b/src/modes/edit/removable_devices.rs
@@ -1,15 +1,14 @@
use anyhow::{anyhow, Result};
+use crate::common::GIO;
+use crate::common::{current_uid, is_dir_empty, is_program_in_path};
+use crate::impl_content;
+use crate::impl_selectable;
use crate::io::execute_and_output;
use crate::log_info;
use crate::log_line;
use crate::modes::PasswordHolder;
use crate::modes::{MountCommands, MountRepr};
-use crate::{
- common::GIO,
- common::{current_uid, is_dir_empty, is_program_in_path},
- impl_selectable_content,
-};
/// Holds info about removable devices.
/// We can navigate this struct.
@@ -52,16 +51,6 @@ impl RemovableDevices {
Some(Self { content, index: 0 })
}
}
-
- /// Mutable reference to the selected element.
- /// None if the content is empty (aka no removable device detected)
- pub fn selected_mut(&mut self) -> Option<&mut Removable> {
- if self.content.is_empty() {
- None
- } else {
- Some(&mut self.content[self.index])
- }
- }
}
/// Holds a MTP device name, a path and a flag set to true
@@ -169,4 +158,6 @@ impl MountRepr for Removable {
}
}
-impl_selectable_content!(Removable, RemovableDevices);
+// impl_selectable_content!(Removable, RemovableDevices);
+impl_selectable!(RemovableDevices);
+impl_content!(Removable, RemovableDevices);