Skip to content

Commit

Permalink
refactor: tui.rs and add basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xricksanchez committed Nov 22, 2024
1 parent bbcf074 commit 6bf802a
Show file tree
Hide file tree
Showing 2 changed files with 273 additions and 89 deletions.
8 changes: 2 additions & 6 deletions src/data_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ macro_rules! calculate_average {
macro_rules! calculate_minmax_average {
// Case for floating point min-max
($field:expr) => {
if $field.max != 0.0 || $field.min != 0.0 {
$field.avg = ($field.min + $field.max) / 2.0;
}
$field.avg = ($field.min + $field.max) / 2.0;
};
// Case for integer min-max
($field:expr, integer) => {
if $field.max != 0 || $field.min != 0 {
$field.avg = ($field.min + $field.max) / 2;
}
$field.avg = ($field.min + $field.max) / 2;
};
}

Expand Down
Loading

0 comments on commit 6bf802a

Please sign in to comment.