File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -261,8 +261,7 @@ fn main() {
261261 . any ( |diff_result| diff_result. has_reportable_change ( ) ) ;
262262 display:: json:: print_directory ( results, display_options. print_unchanged ) ;
263263 } else if display_options. sort_paths {
264- let mut result: Vec < DiffResult > = diff_iter. collect ( ) ;
265- result. sort_unstable_by ( |a, b| a. display_path . cmp ( & b. display_path ) ) ;
264+ let result: Vec < DiffResult > = diff_iter. collect ( ) ;
266265 for diff_result in result {
267266 print_diff_result ( & display_options, & diff_result) ;
268267
@@ -732,7 +731,10 @@ fn diff_directories<'a>(
732731 // We greedily list all files in the directory, and then diff them
733732 // in parallel. This is assuming that diffing is slower than
734733 // enumerating files, so it benefits more from parallelism.
735- let paths = relative_paths_in_either ( lhs_dir, rhs_dir) ;
734+ let mut paths = relative_paths_in_either ( lhs_dir, rhs_dir) ;
735+ if display_options. sort_paths {
736+ paths. sort_unstable ( ) ;
737+ }
736738
737739 paths. into_par_iter ( ) . map ( move |rel_path| {
738740 info ! ( "Relative path is {:?} inside {:?}" , rel_path, lhs_dir) ;
You can’t perform that action at this time.
0 commit comments