Cargo fmt

This commit is contained in:
Loïc Lecrenier 2023-03-19 15:15:58 +01:00
parent a59ca28e2c
commit fbb1ba3de0
7 changed files with 19 additions and 29 deletions

View File

@ -70,10 +70,6 @@ pub mod update;
#[macro_use]
pub mod snapshot_tests;
pub use search::new::DetailedSearchLogger;
pub use search::new::{execute_search, DefaultSearchLogger, SearchContext};
use std::collections::{BTreeMap, HashMap};
use std::convert::{TryFrom, TryInto};
use std::hash::BuildHasherDefault;
@ -81,6 +77,7 @@ use std::hash::BuildHasherDefault;
pub use filter_parser::{Condition, FilterCondition, Span, Token};
use fxhash::{FxHasher32, FxHasher64};
pub use grenad::CompressionType;
pub use search::new::{execute_search, DefaultSearchLogger, DetailedSearchLogger, SearchContext};
use serde_json::Value;
pub use {charabia as tokenizer, heed};

View File

@ -1,19 +1,15 @@
use heed::{
types::{ByteSlice, Str, Unit},
Database, RoPrefix, RoTxn,
};
use heed::types::{ByteSlice, Str, Unit};
use heed::{Database, RoPrefix, RoTxn};
use roaring::RoaringBitmap;
const FID_SIZE: usize = 2;
const DOCID_SIZE: usize = 4;
use crate::{
heed_codec::{
facet::{FacetGroupKey, FacetGroupKeyCodec, FacetGroupValueCodec, FieldDocIdFacetCodec},
ByteSliceRefCodec,
},
Index, Result, SearchContext,
use crate::heed_codec::facet::{
FacetGroupKey, FacetGroupKeyCodec, FacetGroupValueCodec, FieldDocIdFacetCodec,
};
use crate::heed_codec::ByteSliceRefCodec;
use crate::{Index, Result, SearchContext};
pub struct DistinctOutput {
pub remaining: RoaringBitmap,

View File

@ -13,9 +13,7 @@ use crate::search::new::ranking_rule_graph::{
DeadEndsCache, Edge, ProximityCondition, ProximityGraph, RankingRuleGraph,
RankingRuleGraphTrait, TypoCondition, TypoGraph,
};
use crate::search::new::small_bitmap::SmallBitmap;
use crate::search::new::{QueryGraph, QueryNode, SearchContext};
use crate::search::new::{RankingRule, SearchLogger};
use crate::search::new::{QueryGraph, QueryNode, RankingRule, SearchContext, SearchLogger};
pub enum SearchEvents {
RankingRuleStartIteration {

View File

@ -16,17 +16,15 @@ mod sort;
mod words;
// #[cfg(test)]
pub use logger::detailed::DetailedSearchLogger;
pub use logger::{DefaultSearchLogger, SearchLogger};
use std::collections::{BTreeSet, HashSet};
use crate::{Filter, Index, MatchingWords, Result, Search, SearchResult, TermsMatchingStrategy};
use charabia::Tokenize;
use db_cache::DatabaseCache;
use graph_based_ranking_rule::{Proximity, Typo};
use heed::RoTxn;
use interner::DedupInterner;
pub use logger::detailed::DetailedSearchLogger;
pub use logger::{DefaultSearchLogger, SearchLogger};
use query_graph::{QueryGraph, QueryNode, QueryNodeData};
use query_term::{located_query_terms_from_string, Phrase, QueryTerm};
use ranking_rules::{bucket_sort, PlaceholderQuery, RankingRuleOutput, RankingRuleQueryTrait};
@ -35,6 +33,7 @@ use roaring::RoaringBitmap;
use words::Words;
use self::ranking_rules::RankingRule;
use crate::{Filter, Index, MatchingWords, Result, Search, SearchResult, TermsMatchingStrategy};
/// A structure used throughout the execution of a search query.
pub struct SearchContext<'ctx> {

View File

@ -1,7 +1,5 @@
use crate::search::new::{
interner::{FixedSizeInterner, Interned},
small_bitmap::SmallBitmap,
};
use crate::search::new::interner::{FixedSizeInterner, Interned};
use crate::search::new::small_bitmap::SmallBitmap;
pub struct DeadEndsCache<T> {
conditions: Vec<Interned<T>>,

View File

@ -1,6 +1,8 @@
#![allow(clippy::too_many_arguments)]
use std::collections::BTreeMap;
use heed::RoTxn;
use super::ProximityCondition;
use crate::search::new::db_cache::DatabaseCache;
use crate::search::new::interner::{DedupInterner, Interned};
@ -9,7 +11,6 @@ use crate::search::new::query_term::{LocatedQueryTerm, Phrase, QueryTerm};
use crate::search::new::ranking_rule_graph::proximity::WordPair;
use crate::search::new::{QueryNode, SearchContext};
use crate::Result;
use heed::RoTxn;
fn last_word_of_term_iter<'t>(
t: &'t QueryTerm,

View File

@ -1,3 +1,7 @@
use std::collections::HashSet;
use std::fmt::Write;
use std::iter::FromIterator;
use roaring::RoaringBitmap;
use super::{DeadEndsCache, RankingRuleGraph, RankingRuleGraphTrait};
@ -7,9 +11,6 @@ use crate::search::new::query_graph::QueryNodeData;
use crate::search::new::query_term::{LocatedQueryTerm, Phrase, QueryTerm};
use crate::search::new::{QueryGraph, QueryNode, SearchContext};
use crate::Result;
use std::collections::HashSet;
use std::fmt::Write;
use std::iter::FromIterator;
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct TypoCondition {