@@ -73,12 +73,8 @@ const BYTE_TABLE: [bool; 256] = create_table();
73
73
fn build_display_str ( args : & Args , count : & CountInfo , filename : & OsStr ) -> String {
74
74
let mut output = String :: with_capacity ( filename. len ( ) + ( 3 * 10 ) ) ;
75
75
76
- let multi_file = args. files . len ( ) > 1 ;
77
- let only_lines = ( args. words == false ) && ( args. bytes == false ) && ( args. chars == false ) ;
78
- let only_words = ( args. lines == false ) && ( args. bytes == false ) && ( args. chars == false ) ;
79
- let only_bytechars = ( args. lines == false ) && ( args. words == false ) ;
80
-
81
76
if args. lines {
77
+ let only_lines = !args. words && !args. bytes && !args. chars ;
82
78
let numstr = match only_lines {
83
79
true => format ! ( "{}" , count. nl) ,
84
80
false => format ! ( "{:>8}" , count. nl) ,
@@ -89,6 +85,7 @@ fn build_display_str(args: &Args, count: &CountInfo, filename: &OsStr) -> String
89
85
if !output. is_empty ( ) {
90
86
output. push ( ' ' ) ;
91
87
}
88
+ let only_words = !args. lines && !args. bytes && !args. chars ;
92
89
let numstr = match only_words {
93
90
true => format ! ( "{}" , count. words) ,
94
91
false => format ! ( "{:>8}" , count. words) ,
@@ -99,13 +96,15 @@ fn build_display_str(args: &Args, count: &CountInfo, filename: &OsStr) -> String
99
96
if !output. is_empty ( ) {
100
97
output. push ( ' ' ) ;
101
98
}
99
+ let only_bytechars = !args. lines && !args. words ;
102
100
let numstr = match only_bytechars {
103
101
true => format ! ( "{}" , count. chars) ,
104
102
false => format ! ( "{:>8}" , count. chars) ,
105
103
} ;
106
104
output. push_str ( & numstr) ;
107
105
}
108
106
107
+ let multi_file = args. files . len ( ) > 1 ;
109
108
if multi_file {
110
109
output. push ( ' ' ) ;
111
110
0 commit comments