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 authored and cryptonemo committed Jun 18, 2020
1 parent 78e414b commit 5bdc49d
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 5bdc49d

Please sign in to comment.