Explorar o código

Use mutable slice instead of creating new Vec in filters

Victor Song %!s(int64=3) %!d(string=hai) anos
pai
achega
433a9a52d3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/fs/filter.rs

+ 1 - 1
src/fs/filter.rs

@@ -89,7 +89,7 @@ impl FileFilter {
     }
 
     /// Sort the files in the given vector based on the sort field option.
-    pub fn sort_files<'a, F>(&self, files: &mut Vec<F>)
+    pub fn sort_files<'a, F>(&self, files: &mut [F])
     where F: AsRef<File<'a>>
     {
         files.sort_by(|a, b| {