@@ -82,8 +82,8 @@ pub fn list() -> Result<Vec<TrashItem>, Error> {
8282 // Get all mount-points and attempt to find a trash folder in each adding them to the SET of
8383 // trash folders when found one.
8484 let uid = unsafe { libc:: getuid ( ) } ;
85- let mount_points = get_sorted_mount_points ( ) ?;
86- for mount in & mount_points {
85+ let sorted_mount_points = get_sorted_mount_points ( ) ?;
86+ for mount in & sorted_mount_points {
8787 execute_on_mounted_trash_folders ( uid, & mount. mnt_dir , false , false , |trash_path| {
8888 trash_folders. insert ( trash_path) ;
8989 Ok ( ( ) )
@@ -98,7 +98,7 @@ pub fn list() -> Result<Vec<TrashItem>, Error> {
9898 let mut result = Vec :: new ( ) ;
9999 for folder in & trash_folders {
100100 // Read the info files for every file
101- let top_dir = get_first_topdir_containing_path ( folder, & mount_points ) ;
101+ let top_dir = get_first_topdir_containing_path ( folder, & sorted_mount_points ) ;
102102 let info_folder = folder. join ( "info" ) ;
103103 if !info_folder. is_dir ( ) {
104104 warn ! ( "The path {:?} did not point to a directory, skipping this trash folder." , info_folder) ;
@@ -639,7 +639,6 @@ struct MountPoint {
639639 _mnt_fsname : String ,
640640}
641641
642- #[ cfg( target_os = "linux" ) ]
643642fn get_sorted_mount_points ( ) -> Result < Vec < MountPoint > , Error > {
644643 // Returns longest mount points first
645644 let mut mount_points = get_mount_points ( ) ?;
0 commit comments