mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-23 02:29:57 +00:00
cargo fmt
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
use tantivy::schema::*;
|
||||
|
||||
// # Document from json
|
||||
|
||||
@@ -369,7 +369,6 @@ mod tests {
|
||||
schema::{Schema, TEXT},
|
||||
IndexSettings, IndexSortByField, Order,
|
||||
};
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_serialize_metas() {
|
||||
|
||||
@@ -46,11 +46,7 @@ fn codec_estimation<T: FastFieldCodecSerializer, A: FastFieldDataAccess>(
|
||||
if !T::is_applicable(fastfield_accessor, stats.clone()) {
|
||||
return;
|
||||
}
|
||||
let (ratio, name, id) = (
|
||||
T::estimate(fastfield_accessor, stats),
|
||||
T::NAME,
|
||||
T::ID,
|
||||
);
|
||||
let (ratio, name, id) = (T::estimate(fastfield_accessor, stats), T::NAME, T::ID);
|
||||
estimations.push((ratio, name, id));
|
||||
}
|
||||
|
||||
|
||||
@@ -231,13 +231,7 @@ pub trait PostingsWriter {
|
||||
// We skip all tokens with a len greater than u16.
|
||||
if token.text.len() <= MAX_TOKEN_LEN {
|
||||
term_buffer.set_text(token.text.as_str());
|
||||
self.subscribe(
|
||||
term_index,
|
||||
doc_id,
|
||||
token.position as u32,
|
||||
term_buffer,
|
||||
heap,
|
||||
);
|
||||
self.subscribe(term_index, doc_id, token.position as u32, term_buffer, heap);
|
||||
} else {
|
||||
warn!(
|
||||
"A token exceeding MAX_TOKEN_LEN ({}>{}) was dropped. Search for \
|
||||
|
||||
@@ -318,7 +318,8 @@ mod tests {
|
||||
let docset_factory = || {
|
||||
let res: Box<dyn DocSet> = Box::new(Union::<_, DoNothingCombiner>::from(
|
||||
docs_list
|
||||
.iter().cloned()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(VecDocSet::from)
|
||||
.map(|docset| ConstScorer::new(docset, 1.0))
|
||||
.collect::<Vec<_>>(),
|
||||
|
||||
@@ -40,7 +40,7 @@ impl fmt::Debug for Checkpoint {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
use std::{io};
|
||||
use std::io;
|
||||
|
||||
use futures::executor::block_on;
|
||||
use proptest::strategy::{BoxedStrategy, Strategy};
|
||||
@@ -216,7 +216,8 @@ mod tests {
|
||||
target: DocId,
|
||||
) -> Option<Checkpoint> {
|
||||
checkpoints
|
||||
.into_iter().find(|checkpoint| checkpoint.doc_range.end > target)
|
||||
.into_iter()
|
||||
.find(|checkpoint| checkpoint.doc_range.end > target)
|
||||
}
|
||||
|
||||
fn test_skip_index_aux(skip_index: SkipIndex, checkpoints: &[Checkpoint]) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
use std::path::Path;
|
||||
use tantivy::directory::{Directory, ManagedDirectory, RamDirectory, TerminatingWrite};
|
||||
use tantivy::doc;
|
||||
|
||||
Reference in New Issue
Block a user