replace unwrap, use vec in bench

This commit is contained in:
Pascal Seitz
2021-06-14 17:01:46 +02:00
parent c889ae10e4
commit 77a0902605
2 changed files with 3 additions and 2 deletions

View File

@@ -27,7 +27,8 @@ mod tests {
}
fn value_iter() -> impl Iterator<Item = u64> {
0..20_000
let data = (0..20_000).collect::<Vec<_>>();
data.into_iter()
}
fn bench_get<S: FastFieldCodecSerializer, R: FastFieldCodecReader>(
b: &mut Bencher,

View File

@@ -209,7 +209,7 @@ impl FastFieldCodecSerializer for LinearInterpolFastFieldSerializer {
distance(calculated_value, actual_value)
})
.max()
.unwrap();
.unwrap_or(0);
// the theory would be that we don't have the actual max_distance, but we are close within 50%
// threshold.