Ignore capital letters when sorting files

This commit is contained in:
ChristianVisintin
2020-12-09 16:35:16 +01:00
parent b3537afd2e
commit 93977cc714
2 changed files with 7 additions and 3 deletions

View File

@@ -10,7 +10,11 @@
Work in progress Work in progress
- password prompt: ask before performing terminal clear - enhancements:
- password prompt: ask before performing terminal clear
- file explorer: file names are now sorted ignoring capital letters
- bugfix:
- prevent panic in set_progress, for progress values `> 100.0 or < 0.0`
## 0.1.0 ## 0.1.0

View File

@@ -159,8 +159,8 @@ impl FileExplorer {
/// Sort explorer files by their name /// Sort explorer files by their name
pub fn sort_files_by_name(&mut self) { pub fn sort_files_by_name(&mut self) {
self.files.sort_by_key(|x: &FsEntry| match x { self.files.sort_by_key(|x: &FsEntry| match x {
FsEntry::Directory(dir) => dir.name.clone(), FsEntry::Directory(dir) => dir.name.as_str().to_lowercase(),
FsEntry::File(file) => file.name.clone(), FsEntry::File(file) => file.name.as_str().to_lowercase(),
}); });
} }
} }