Skip to content

Commit

Permalink
fix clippy::legacy_numeric_constants
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Apr 12, 2024
1 parent 974402d commit 82d0ff6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/themes/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ pub fn approx(a: f64, b: f64) -> bool {
let abs_a = a.abs();
let abs_b = b.abs();
let diff = (abs_a - abs_b).abs();
if a == 0.0 || b == 0.0 || abs_a + abs_b < std::f64::EPSILON {
diff < eps * std::f64::EPSILON
if a == 0.0 || b == 0.0 || abs_a + abs_b < f64::EPSILON {
diff < eps * f64::EPSILON
} else {
diff / (abs_a + abs_b).min(std::f64::MAX) < eps
diff / (abs_a + abs_b).min(f64::MAX) < eps
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ pub fn format_bar_graph(content: &[f64]) -> String {
];

// Find min and max
let mut min = std::f64::INFINITY;
let mut max = -std::f64::INFINITY;
let mut min = f64::INFINITY;
let mut max = f64::NEG_INFINITY;
for &v in content {
min = min.min(v);
max = max.max(v);
Expand Down

0 comments on commit 82d0ff6

Please sign in to comment.