diff options
Diffstat (limited to 'src/shortcut.rs')
-rw-r--r-- | src/shortcut.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shortcut.rs b/src/shortcut.rs index 8129f19..f7e4506 100644 --- a/src/shortcut.rs +++ b/src/shortcut.rs @@ -5,6 +5,7 @@ use std::str::FromStr; use crate::constant_strings_paths::{CONFIG_FOLDER, HARDCODED_SHORTCUTS}; use crate::git::git_root; use crate::impl_selectable_content; +use crate::utils::current_uid; /// Holds the hardcoded and mountpoints shortcuts the user can jump to. /// Also know which shortcut is currently selected by the user. @@ -95,11 +96,14 @@ impl Shortcut { /// Update the shortcuts with MTP mount points fn extend_with_mtp(&mut self) { - let uid = users::get_current_uid(); + let Ok(uid) = current_uid() else { + return; + }; let mtp_mount_point = PathBuf::from(format!("/run/user/{uid}/gvfs/")); if !mtp_mount_point.exists() || !mtp_mount_point.is_dir() { return; } + let mount_points: Vec<PathBuf> = match std::fs::read_dir(&mtp_mount_point) { Ok(read_dir) => read_dir .filter_map(|direntry| direntry.ok()) |