alphabetical

This commit is contained in:
EvilMuffinHa 2022-03-02 20:07:11 -05:00
parent 2435a5728f
commit 765884f79f

View File

@ -169,8 +169,11 @@ fn delete(path: PathBuf, _guard: AdminUser) -> Redirect {
fn directory_structure(path: String) -> HashMap<&'static str, HashMap<i32, DirPath>> {
let dir = Path::new(path.as_str());
let paths = fs::read_dir(dir).unwrap()
let mut sort = fs::read_dir(dir).unwrap()
.map(|x| x.unwrap().path().into_os_string().into_string().unwrap())
.collect::<Vec<String>>();
sort.sort();
let paths = sort.into_iter()
.enumerate()
.map(|x| (x.0 as i32, DirPath {
is_file: Path::new(&x.1).is_file(),