Skip to main content

sort_files

Function sort_files 

Source
pub fn sort_files<'a, T, S>(files_to_sort: T) -> Vec<&'a S>
where T: ParallelIterator<Item = &'a S>, S: FileOps + Sync + 'a,
Expand description

Sorts (unstable) file paths in descending order by number of components, in parallel

§Arguments

files_to_sort: files to sort

§Returns

A vector of file paths in descending order by number of components

§Examples

[“a”, “a/b”, “a/b/c”] becomes [“a/b/c”, “a/b”, “a”] [“/usr”, “/”, “/usr/bin”, “/etc”] becomes [“/usr/bin”, “/usr”, “/etc”, “/”]