@@ -303,10 +303,10 @@ where
303303 match field {
304304 RepoFilesSortField :: Name => {
305305 dirs. sort_by ( |a, b| {
306- direction. ordering ( a. name_lower_force ( ) . cmp ( b. name_lower_force ( ) ) )
306+ direction. ordering ( natord :: compare ( a. name_lower_force ( ) , b. name_lower_force ( ) ) )
307307 } ) ;
308308 files. sort_by ( |a, b| {
309- direction. ordering ( a. name_lower_force ( ) . cmp ( b. name_lower_force ( ) ) )
309+ direction. ordering ( natord :: compare ( a. name_lower_force ( ) , b. name_lower_force ( ) ) )
310310 } ) ;
311311 }
312312 RepoFilesSortField :: Size => {
@@ -333,7 +333,7 @@ where
333333 match field {
334334 RepoFilesSortField :: Name => {
335335 files. sort_by ( |a, b| {
336- direction. ordering ( a. name_lower_force ( ) . cmp ( b. name_lower_force ( ) ) )
336+ direction. ordering ( natord :: compare ( a. name_lower_force ( ) , b. name_lower_force ( ) ) )
337337 } ) ;
338338 }
339339 RepoFilesSortField :: Size => {
@@ -670,7 +670,7 @@ mod tests {
670670 } ,
671671 ) ;
672672
673- assert_eq ! ( asc, vec![ "19foo .txt" , "1foo .txt" , "2foo .txt" ] ) ;
673+ assert_eq ! ( asc, vec![ "1foo .txt" , "2foo .txt" , "19foo .txt" ] ) ;
674674 }
675675
676676 #[ test]
@@ -690,7 +690,7 @@ mod tests {
690690 } ,
691691 ) ;
692692
693- assert_eq ! ( asc, vec![ "1 foo.txt" , "19 foo.txt" , "2 foo.txt" ] ) ;
693+ assert_eq ! ( asc, vec![ "1 foo.txt" , "2 foo.txt" , "19 foo.txt" ] ) ;
694694 }
695695
696696 #[ test]
@@ -710,7 +710,7 @@ mod tests {
710710 } ,
711711 ) ;
712712
713- assert_eq ! ( asc, vec![ "foo1.txt" , "foo19 .txt" , "foo2 .txt" ] ) ;
713+ assert_eq ! ( asc, vec![ "foo1.txt" , "foo2 .txt" , "foo19 .txt" ] ) ;
714714 }
715715
716716 #[ test]
@@ -730,6 +730,6 @@ mod tests {
730730 } ,
731731 ) ;
732732
733- assert_eq ! ( asc, vec![ "foo 1.txt" , "foo 19 .txt" , "foo 2 .txt" ] ) ;
733+ assert_eq ! ( asc, vec![ "foo 1.txt" , "foo 2 .txt" , "foo 19 .txt" ] ) ;
734734 }
735735}
0 commit comments