Skip to content

Commit

Permalink
commands/describe: Print 0 sequence lengths when there are no records
Browse files Browse the repository at this point in the history
  • Loading branch information
zaeleus committed Nov 11, 2024
1 parent 05ca093 commit b0487bf
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/commands/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,23 @@ fn visit(metrics: &mut Metrics, _: &Record) {
}

fn print_metrics(metrics: &Metrics) {
println!("record_count\t{}", metrics.record_count);
println!("min_sequence_length\t{}", metrics.min_sequence_length);
println!("max_sequence_length\t{}", metrics.max_sequence_length);
let record_count = metrics.record_count;

println!("record_count\t{record_count}");

let min_sequence_length = if record_count == 0 {
0
} else {
metrics.min_sequence_length
};

println!("min_sequence_length\t{min_sequence_length}");

let max_sequence_length = if record_count == 0 {
0
} else {
metrics.max_sequence_length
};

println!("max_sequence_length\t{max_sequence_length}");
}

0 comments on commit b0487bf

Please sign in to comment.