@@ -141,14 +141,13 @@ fn main() {
141141 assert ! ( !opt. raw, "--raw and --hh cannot be set simultaneously" ) ;
142142 assert ! ( !opt. merge, "--merge and --hh cannot be set simultaneously" ) ;
143143 if k == 0 {
144- return
144+ return ;
145145 }
146- let reduced =
147- reduce_stream ( io:: stdin ( ) . lock ( ) , HeavyHitter :: new ( k) ) . expect ( "no io error" ) ;
146+ let reduced = reduce_stream ( io:: stdin ( ) . lock ( ) , HeavyHitter :: new ( k) ) . expect ( "no io error" ) ;
148147 for ( line, count) in reduced. estimate ( ) {
149148 println ! ( "{} {}" , count, str :: from_utf8( line) . expect( "valid UTF-8" ) ) ;
150149 }
151- return
150+ return ;
152151 }
153152
154153 match ( opt. key , opt. merge ) {
@@ -221,10 +220,12 @@ mod tests {
221220 . success ( )
222221 . get_output ( )
223222 . clone ( ) ;
224- assert ! ( out. stderr. is_empty( ) , "stderr {}" ,
225- str :: from_utf8( & out. stderr) . expect( "valid UTF-8" ) ) ;
226- out
227- . stdout
223+ assert ! (
224+ out. stderr. is_empty( ) ,
225+ "stderr {}" ,
226+ str :: from_utf8( & out. stderr) . expect( "valid UTF-8" )
227+ ) ;
228+ out. stdout
228229 }
229230
230231 fn eval_bash ( cmd : & str ) -> Vec < u8 > {
@@ -233,8 +234,11 @@ mod tests {
233234 . arg ( cmd)
234235 . output ( )
235236 . expect ( "datagen process successful" ) ;
236- assert ! ( out. stderr. is_empty( ) , "{}" ,
237- str :: from_utf8( & out. stderr) . unwrap( ) ) ;
237+ assert ! (
238+ out. stderr. is_empty( ) ,
239+ "{}" ,
240+ str :: from_utf8( & out. stderr) . unwrap( )
241+ ) ;
238242 out. stdout
239243 }
240244
@@ -392,14 +396,17 @@ mod tests {
392396 }
393397
394398 fn unix_hh ( k : usize ) -> String {
395- format ! ( "sort | uniq -c | sort -rn | head -{} | sed 's/^ *//' | sort" , k)
399+ format ! (
400+ "sort | uniq -c | sort -rn | head -{} | sed 's/^ *//' | sort" ,
401+ k
402+ )
396403 }
397404
398405 fn validate_unix_hh ( datagen : & str , k : usize ) {
399406 let unix = unix_hh ( k) ;
400407 let kstr = format ! ( "{}" , k) ;
401408 let dsrs = & [ "--hh" , & kstr] ;
402- validate_equal_cmd ( datagen, dsrs, & unix) ;
409+ validate_equal_cmd ( datagen, dsrs, & unix) ;
403410 }
404411
405412 #[ test]
0 commit comments