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 @@ -265,8 +265,7 @@ fn main() {
265265 . any ( |diff_result| diff_result. has_reportable_change ( ) ) ;
266266 display:: json:: print_directory ( results, display_options. print_unchanged ) ;
267267 } else if display_options. sort_paths {
268- let mut result: Vec < DiffResult > = diff_iter. collect ( ) ;
269- result. sort_unstable_by ( |a, b| a. display_path . cmp ( & b. display_path ) ) ;
268+ let result: Vec < DiffResult > = diff_iter. collect ( ) ;
270269 for diff_result in result {
271270 print_diff_result ( & display_options, & diff_result) ;
272271
@@ -748,7 +747,10 @@ fn diff_directories<'a>(
748747 // We greedily list all files in the directory, and then diff them
749748 // in parallel. This is assuming that diffing is slower than
750749 // enumerating files, so it benefits more from parallelism.
751- let paths = relative_paths_in_either ( lhs_dir, rhs_dir) ;
750+ let mut paths = relative_paths_in_either ( lhs_dir, rhs_dir) ;
751+ if display_options. sort_paths {
752+ paths. sort_unstable ( ) ;
753+ }
752754
753755 paths. into_par_iter ( ) . map ( move |rel_path| {
754756 info ! ( "Relative path is {:?} inside {:?}" , rel_path, lhs_dir) ;
You can’t perform that action at this time.
0 commit comments