@@ -368,19 +368,16 @@ mod cmd {
368
368
builder. disable_continuous ( true ) ;
369
369
}
370
370
371
- if let Some ( end_offset) = self . end {
372
- if let Some ( start_offset) = self . start {
373
- if end_offset < start_offset {
374
- eprintln ! (
375
- "Argument end-offset must be greater than or equal to specified start offset"
376
- ) ;
377
- return Err ( CliError :: from ( FluvioError :: CrossingOffsets (
378
- start_offset,
379
- end_offset,
380
- ) )
381
- . into ( ) ) ;
382
- }
383
- }
371
+ if let Some ( end_offset) = self . end
372
+ && let Some ( start_offset) = self . start
373
+ && end_offset < start_offset
374
+ {
375
+ eprintln ! (
376
+ "Argument end-offset must be greater than or equal to specified start offset"
377
+ ) ;
378
+ return Err (
379
+ CliError :: from ( FluvioError :: CrossingOffsets ( start_offset, end_offset) ) . into ( ) ,
380
+ ) ;
384
381
}
385
382
386
383
if let Some ( isolation) = self . isolation {
@@ -507,12 +504,11 @@ mod cmd {
507
504
& pb,
508
505
) ;
509
506
510
- if let Some ( potential_offset) = maybe_potential_end_offset {
511
- if record. offset >= potential_offset as i64 {
507
+ if let Some ( potential_offset) = maybe_potential_end_offset
508
+ && record. offset >= potential_offset as i64 {
512
509
eprintln!( "End-offset has been reached; exiting" ) ;
513
510
break ;
514
511
}
515
- }
516
512
} ,
517
513
None => break ,
518
514
} ,
@@ -567,12 +563,11 @@ mod cmd {
567
563
& pb,
568
564
) ;
569
565
570
- if let Some ( potential_offset) = maybe_potential_end_offset {
571
- if record. offset >= potential_offset as i64 {
566
+ if let Some ( potential_offset) = maybe_potential_end_offset
567
+ && record. offset >= potential_offset as i64 {
572
568
eprintln!( "End-offset has been reached; exiting" ) ;
573
569
break ;
574
570
}
575
- }
576
571
} ,
577
572
None => break ,
578
573
} ,
@@ -584,12 +579,12 @@ mod cmd {
584
579
}
585
580
}
586
581
587
- if let Some ( ConsumeOutputType :: full_table) = & self . output {
588
- if let Some ( mut terminal_stdout) = maybe_terminal_stdout {
589
- disable_raw_mode ( ) ? ;
590
- execute ! ( terminal_stdout . backend_mut ( ) , LeaveAlternateScreen , ) ?;
591
- terminal_stdout. show_cursor ( ) ?;
592
- }
582
+ if let Some ( ConsumeOutputType :: full_table) = & self . output
583
+ && let Some ( mut terminal_stdout) = maybe_terminal_stdout
584
+ {
585
+ disable_raw_mode ( ) ?;
586
+ execute ! ( terminal_stdout. backend_mut ( ) , LeaveAlternateScreen , ) ?;
587
+ terminal_stdout . show_cursor ( ) ? ;
593
588
}
594
589
595
590
debug ! ( "fetch loop exited" ) ;
@@ -697,10 +692,10 @@ mod cmd {
697
692
// (Some(_), None) only if JSON cannot be printed, so skip.
698
693
_ => debug ! ( "Skipping record that cannot be formatted" ) ,
699
694
}
700
- } else if let Some ( term) = terminal {
701
- if let Some ( table) = table_model {
702
- table . render ( term ) ;
703
- }
695
+ } else if let Some ( term) = terminal
696
+ && let Some ( table) = table_model
697
+ {
698
+ table . render ( term ) ;
704
699
}
705
700
}
706
701
0 commit comments