소스 검색

Use mutable slice instead of creating new Vec in filters

Victor Song 3 년 전
부모
커밋
433a9a52d3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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| {