cargo fmt

This commit is contained in:
Pascal Seitz
2022-03-02 09:24:14 +01:00
parent c0b1a58d27
commit 7fa6a0b665
3 changed files with 7 additions and 8 deletions

View File

@@ -240,17 +240,15 @@ impl SegmentRangeCollector {
/// more computational expensive when many documents are hit.
fn to_u64_range(range: &RangeAggregationRange, field_type: &Type) -> crate::Result<Range<u64>> {
let start = if let Some(from) = range.from {
f64_to_fastfield_u64(from, field_type).ok_or_else(|| {
TantivyError::InvalidArgument("invalid field type".to_string())
})?
f64_to_fastfield_u64(from, field_type)
.ok_or_else(|| TantivyError::InvalidArgument("invalid field type".to_string()))?
} else {
u64::MIN
};
let end = if let Some(to) = range.to {
f64_to_fastfield_u64(to, field_type).ok_or_else(|| {
TantivyError::InvalidArgument("invalid field type".to_string())
})?
f64_to_fastfield_u64(to, field_type)
.ok_or_else(|| TantivyError::InvalidArgument("invalid field type".to_string()))?
} else {
u64::MAX
};

View File

@@ -87,7 +87,8 @@ impl IntermediateStats {
}
pub(crate) fn standard_deviation(&self) -> Option<f64> {
self.avg().map(|average| (self.square_mean() - average * average).sqrt())
self.avg()
.map(|average| (self.square_mean() - average * average).sqrt())
}
/// Merge data from other stats into this instance.

View File

@@ -918,7 +918,7 @@ mod tests {
let collector = AggregationCollector::from_aggs(agg_req_1);
let searcher = reader.searcher();
searcher.search(&AllQuery, &collector).unwrap_err()
};