File tree Expand file tree Collapse file tree 1 file changed +14
-15
lines changed
Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -511,23 +511,22 @@ fn ordering_incompatible(
511511 dictionary_order : bool ,
512512 ignore_non_printing : bool ,
513513) -> bool {
514- let mut count = 0 ;
515- if flags. numeric {
516- count += 1 ;
517- }
518- if flags. general_numeric {
519- count += 1 ;
520- }
521- if flags. human_numeric {
522- count += 1 ;
523- }
524- if flags. month {
525- count += 1 ;
514+ let mode_count = u8:: from ( flags. numeric )
515+ + u8:: from ( flags. general_numeric )
516+ + u8:: from ( flags. human_numeric )
517+ + u8:: from ( flags. month ) ;
518+
519+ // Multiple numeric/month modes are incompatible
520+ if mode_count > 1 {
521+ return true ;
526522 }
527- if flags. version || flags. random || dictionary_order || ignore_non_printing {
528- count += 1 ;
523+
524+ // A numeric/month mode combined with version/random/dictionary/ignore_non_printing is incompatible
525+ if mode_count == 1 {
526+ return flags. version || flags. random || dictionary_order || ignore_non_printing;
529527 }
530- count > 1
528+
529+ false
531530}
532531
533532fn incompatible_options_error ( opts : & str ) -> Box < dyn UError > {
You can’t perform that action at this time.
0 commit comments