mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-25 06:00:08 +01:00
Cargo fmt + fix compiler warnings/error
This commit is contained in:
parent
6066256689
commit
8ac24d3114
@ -490,14 +490,12 @@ impl<'a> From<FilterCondition<'a>> for Filter<'a> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::fmt::Write;
|
use crate::index::tests::TempIndex;
|
||||||
|
use crate::Filter;
|
||||||
use big_s::S;
|
use big_s::S;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use maplit::hashset;
|
use maplit::hashset;
|
||||||
|
use std::fmt::Write;
|
||||||
use crate::index::tests::TempIndex;
|
|
||||||
use crate::Filter;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn empty_db() {
|
fn empty_db() {
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
use crate::{
|
use std::borrow::Cow;
|
||||||
heed_codec::facet::{
|
use std::fmt::Write;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
use heed::types::ByteSlice;
|
||||||
|
use heed::BytesDecode;
|
||||||
|
use roaring::RoaringBitmap;
|
||||||
|
|
||||||
|
use crate::heed_codec::facet::{
|
||||||
FacetLevelValueU32Codec, FacetStringLevelZeroCodec, FacetStringLevelZeroValueCodec,
|
FacetLevelValueU32Codec, FacetStringLevelZeroCodec, FacetStringLevelZeroValueCodec,
|
||||||
FacetStringZeroBoundsValueCodec,
|
FacetStringZeroBoundsValueCodec,
|
||||||
},
|
|
||||||
make_db_snap_from_iter, CboRoaringBitmapCodec, ExternalDocumentsIds, Index,
|
|
||||||
};
|
};
|
||||||
use heed::{types::ByteSlice, BytesDecode};
|
use crate::{make_db_snap_from_iter, CboRoaringBitmapCodec, ExternalDocumentsIds, Index};
|
||||||
use roaring::RoaringBitmap;
|
|
||||||
use std::path::Path;
|
|
||||||
use std::{borrow::Cow, fmt::Write};
|
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn default_db_snapshot_settings_for_test(name: Option<&str>) -> insta::Settings {
|
pub fn default_db_snapshot_settings_for_test(name: Option<&str>) -> insta::Settings {
|
||||||
|
@ -347,11 +347,9 @@ fn write_string_entry(
|
|||||||
mod tests {
|
mod tests {
|
||||||
use std::num::NonZeroUsize;
|
use std::num::NonZeroUsize;
|
||||||
|
|
||||||
use crate::{
|
use crate::db_snap;
|
||||||
db_snap,
|
use crate::documents::documents_batch_reader_from_objects;
|
||||||
documents::{batch_reader_from_documents, documents_batch_reader_from_objects},
|
use crate::index::tests::TempIndex;
|
||||||
index::tests::TempIndex,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_facets_number() {
|
fn test_facets_number() {
|
||||||
@ -378,7 +376,7 @@ mod tests {
|
|||||||
for i in 0..100 {
|
for i in 0..100 {
|
||||||
documents.push(serde_json::json!({ "facet2": i }).as_object().unwrap().clone());
|
documents.push(serde_json::json!({ "facet2": i }).as_object().unwrap().clone());
|
||||||
}
|
}
|
||||||
let documents = batch_reader_from_documents(&documents);
|
let documents = documents_batch_reader_from_objects(documents);
|
||||||
|
|
||||||
index.add_documents(documents).unwrap();
|
index.add_documents(documents).unwrap();
|
||||||
|
|
||||||
|
@ -249,11 +249,9 @@ fn insert_current_prefix_data_in_sorter<'a>(
|
|||||||
mod tests {
|
mod tests {
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
|
|
||||||
use crate::{
|
use crate::db_snap;
|
||||||
db_snap,
|
use crate::documents::{DocumentsBatchBuilder, DocumentsBatchReader};
|
||||||
documents::{DocumentsBatchBuilder, DocumentsBatchReader},
|
use crate::index::tests::TempIndex;
|
||||||
index::tests::TempIndex,
|
|
||||||
};
|
|
||||||
|
|
||||||
fn documents_with_enough_different_words_for_prefixes(prefixes: &[&str]) -> Vec<crate::Object> {
|
fn documents_with_enough_different_words_for_prefixes(prefixes: &[&str]) -> Vec<crate::Object> {
|
||||||
let mut documents = Vec::new();
|
let mut documents = Vec::new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user