Skip to content

Commit

Permalink
refactor(fil-proofs-tooling): all clippy lint float_cmp
Browse files Browse the repository at this point in the history
We use a couple of strict float comparisons to test. In each case the
strict comparison is ok.

Add a lint ignore and also comment each site that does strict float
comparison.
  • Loading branch information
tcharding committed Jun 16, 2020
1 parent 429e596 commit 5d67be3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fil-proofs-tooling/src/bin/micro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,10 @@ mod tests {
use super::*;

#[test]
#[allow(clippy::float_cmp)]
fn test_time_to_us() {
assert_eq!(time_to_us("123.12 us"), 123.12);
assert_eq!(time_to_us("1.0 s"), 1_000_000.);
assert_eq!(time_to_us("123.12 us"), 123.12); // No math done on 'us' so strict float cmp is ok.
assert_eq!(time_to_us("1.0 s"), 1_000_000.); // Multiplication, so strict float cmp is ok.
}

#[test]
Expand Down

0 comments on commit 5d67be3

Please sign in to comment.