From a53536836b79fd3b6e8ba9b1301bb46177a27cd4 Mon Sep 17 00:00:00 2001 From: Filip Bachul Date: Tue, 14 Feb 2023 17:03:44 +0100 Subject: [PATCH] fmt --- milli/src/asc_desc.rs | 1 - milli/src/search/facet/filter.rs | 23 +++++++++-------------- milli/src/search/facet/mod.rs | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/milli/src/asc_desc.rs b/milli/src/asc_desc.rs index 2e3892707..bbc49ea7d 100644 --- a/milli/src/asc_desc.rs +++ b/milli/src/asc_desc.rs @@ -28,7 +28,6 @@ impl From for AscDescError { } } - impl From for CriterionError { fn from(error: AscDescError) -> Self { match error { diff --git a/milli/src/search/facet/filter.rs b/milli/src/search/facet/filter.rs index 585d59a29..a4ac53950 100644 --- a/milli/src/search/facet/filter.rs +++ b/milli/src/search/facet/filter.rs @@ -389,14 +389,10 @@ impl<'a> Filter<'a> { let base_point: [f64; 2] = [point[0].parse_finite_float()?, point[1].parse_finite_float()?]; if !(-90.0..=90.0).contains(&base_point[0]) { - return Err( - point[0].as_external_error(BadGeoError::Lat(base_point[0])) - )?; + return Err(point[0].as_external_error(BadGeoError::Lat(base_point[0])))?; } if !(-180.0..=180.0).contains(&base_point[1]) { - return Err( - point[1].as_external_error(BadGeoError::Lng(base_point[1])) - )?; + return Err(point[1].as_external_error(BadGeoError::Lng(base_point[1])))?; } let radius = radius.parse_finite_float()?; let rtree = match index.geo_rtree(rtxn)? { @@ -434,12 +430,14 @@ impl<'a> Filter<'a> { bottom_right_point[1].parse_finite_float()?, ]; if !(-90.0..=90.0).contains(&top_left[0]) { - return Err(top_left_point[0] - .as_external_error(BadGeoError::Lat(top_left[0])))?; + return Err( + top_left_point[0].as_external_error(BadGeoError::Lat(top_left[0])) + )?; } if !(-180.0..=180.0).contains(&top_left[1]) { - return Err(top_left_point[1] - .as_external_error(BadGeoError::Lng(top_left[1])))?; + return Err( + top_left_point[1].as_external_error(BadGeoError::Lng(top_left[1])) + )?; } if !(-90.0..=90.0).contains(&bottom_right[0]) { return Err(bottom_right_point[0] @@ -451,10 +449,7 @@ impl<'a> Filter<'a> { } if top_left[0] < bottom_right[0] { return Err(bottom_right_point[1].as_external_error( - BadGeoError::BoundingBoxTopIsBelowBottom( - top_left[0], - bottom_right[0], - ), + BadGeoError::BoundingBoxTopIsBelowBottom(top_left[0], bottom_right[0]), ))?; } diff --git a/milli/src/search/facet/mod.rs b/milli/src/search/facet/mod.rs index fb93ae00b..c88d4e9e7 100644 --- a/milli/src/search/facet/mod.rs +++ b/milli/src/search/facet/mod.rs @@ -4,7 +4,7 @@ use heed::types::{ByteSlice, DecodeIgnore}; use heed::{BytesDecode, RoTxn}; pub use self::facet_distribution::{FacetDistribution, DEFAULT_VALUES_PER_FACET}; -pub use self::filter::{Filter, BadGeoError}; +pub use self::filter::{BadGeoError, Filter}; use crate::heed_codec::facet::{FacetGroupKeyCodec, FacetGroupValueCodec}; use crate::heed_codec::ByteSliceRefCodec; mod facet_distribution;