Skip to content

Commit

Permalink
Merge pull request #468 from hatoo/clippy-nan
Browse files Browse the repository at this point in the history
fix nightly clippy
  • Loading branch information
hatoo authored Apr 20, 2024
2 parents 1a579c7 + e2b072c commit 7666428
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl Monitor {
.map(|r| r.duration())
.max()
.map(|d| d.as_secs_f64())
.unwrap_or(std::f64::NAN)
.unwrap_or(f64::NAN)
),
Style::default().fg(colors.yellow.unwrap_or(Color::Reset)),
)]),
Expand All @@ -258,7 +258,7 @@ impl Monitor {
.map(|r| r.duration())
.min()
.map(|d| d.as_secs_f64())
.unwrap_or(std::f64::NAN)
.unwrap_or(f64::NAN)
),
Style::default().fg(colors.green.unwrap_or(Color::Reset)),
)]),
Expand Down
2 changes: 1 addition & 1 deletion src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ fn percentile_iter(values: &mut [f64]) -> impl Iterator<Item = (f64, f64)> + '_
.iter()
.map(move |&p| {
let i = (p / 100.0 * values.len() as f64) as usize;
(p, *values.get(i).unwrap_or(&std::f64::NAN))
(p, *values.get(i).unwrap_or(&f64::NAN))
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/result_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn percentile_iter(values: &mut [f64]) -> impl Iterator<Item = (f64, f64)> + '_
.iter()
.map(move |&p| {
let i = (p / 100.0 * values.len() as f64) as usize;
(p, *values.get(i).unwrap_or(&std::f64::NAN))
(p, *values.get(i).unwrap_or(&f64::NAN))
})
}

Expand Down

0 comments on commit 7666428

Please sign in to comment.