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 @@ -259,8 +259,7 @@ fn main() {
259259 . any ( |diff_result| diff_result. has_reportable_change ( ) ) ;
260260 display:: json:: print_directory ( results) ;
261261 } else if display_options. sort_paths {
262- let mut result: Vec < DiffResult > = diff_iter. collect ( ) ;
263- result. sort_unstable_by ( |a, b| a. display_path . cmp ( & b. display_path ) ) ;
262+ let result: Vec < DiffResult > = diff_iter. collect ( ) ;
264263 for diff_result in result {
265264 print_diff_result ( & display_options, & diff_result) ;
266265
@@ -775,7 +774,10 @@ fn diff_directories<'a>(
775774 // We greedily list all files in the directory, and then diff them
776775 // in parallel. This is assuming that diffing is slower than
777776 // enumerating files, so it benefits more from parallelism.
778- let paths = relative_paths_in_either ( lhs_dir, rhs_dir) ;
777+ let mut paths = relative_paths_in_either ( lhs_dir, rhs_dir) ;
778+ if display_options. sort_paths {
779+ paths. sort_unstable ( ) ;
780+ }
779781
780782 paths. into_par_iter ( ) . map ( move |rel_path| {
781783 info ! ( "Relative path is {:?} inside {:?}" , rel_path, lhs_dir) ;
You can’t perform that action at this time.
0 commit comments