mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
format the whole project
This commit is contained in:
parent
ba30cef987
commit
9716fb3b36
68 changed files with 3327 additions and 2336 deletions
|
@ -1,4 +1,5 @@
|
|||
use std::cmp;
|
||||
|
||||
use crate::{Attribute, Position};
|
||||
|
||||
const ONE_ATTRIBUTE: u32 = 1000;
|
||||
|
@ -15,8 +16,11 @@ pub fn index_proximity(lhs: u32, rhs: u32) -> u32 {
|
|||
pub fn positions_proximity(lhs: Position, rhs: Position) -> u32 {
|
||||
let (lhs_attr, lhs_index) = extract_position(lhs);
|
||||
let (rhs_attr, rhs_index) = extract_position(rhs);
|
||||
if lhs_attr != rhs_attr { MAX_DISTANCE }
|
||||
else { index_proximity(lhs_index, rhs_index) }
|
||||
if lhs_attr != rhs_attr {
|
||||
MAX_DISTANCE
|
||||
} else {
|
||||
index_proximity(lhs_index, rhs_index)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn extract_position(position: Position) -> (Attribute, Position) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue