mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 16:18:57 +00:00
Fix clippy errors
This commit is contained in:
1 parent
1aefe14d67
commit
de59bb5ff1
2 files changed
+11
-7
No files matched your search
@@ -136,11 +136,15 @@ pub fn write_benchmark_comparison(results: &[BenchmarkResult]) {
|
||||
|
||||
#[test]
|
||||
fn test_max() {
|
||||
assert_eq!(1.0, max(&[1.0]));
|
||||
assert_eq!(-1.0, max(&[-1.0]));
|
||||
assert_eq!(-1.0, max(&[-2.0, -1.0]));
|
||||
assert_eq!(1.0, max(&[-1.0, 1.0]));
|
||||
assert_eq!(1.0, max(&[-1.0, 1.0, 0.0]));
|
||||
let assert_float_eq = |a, b| {
|
||||
assert!((a - b) < f64::EPSILON);
|
||||
};
|
||||
|
||||
assert_float_eq(1.0, max(&[1.0]));
|
||||
assert_float_eq(-1.0, max(&[-1.0]));
|
||||
assert_float_eq(-1.0, max(&[-2.0, -1.0]));
|
||||
assert_float_eq(1.0, max(&[-1.0, 1.0]));
|
||||
assert_float_eq(1.0, max(&[-1.0, 1.0, 0.0]));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -82,8 +82,8 @@ fn test_cpu_time_interval() {
|
||||
};
|
||||
|
||||
let t_zero = cpu_time_interval(&t_a, &t_a);
|
||||
assert_eq!(0.0, t_zero.user);
|
||||
assert_eq!(0.0, t_zero.system);
|
||||
assert!(t_zero.user.abs() < f64::EPSILON);
|
||||
assert!(t_zero.system.abs() < f64::EPSILON);
|
||||
|
||||
let t_ab = cpu_time_interval(&t_a, &t_b);
|
||||
assert_relative_eq!(0.007655, t_ab.user);
|
||||
|
||||
Reference in new issue
Block a user