cargo fmt

This commit is contained in:
Pascal Seitz
2021-07-01 18:17:08 +02:00
parent 9b3e508753
commit 0062fe705d
7 changed files with 7 additions and 18 deletions

View File

@@ -1,4 +1,3 @@
use tantivy::schema::*;
// # Document from json

View File

@@ -369,7 +369,6 @@ mod tests {
schema::{Schema, TEXT},
IndexSettings, IndexSortByField, Order,
};
#[test]
fn test_serialize_metas() {

View File

@@ -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));
}

View File

@@ -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 \

View File

@@ -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<_>>(),

View File

@@ -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]) {

View File

@@ -1,4 +1,3 @@
use std::path::Path;
use tantivy::directory::{Directory, ManagedDirectory, RamDirectory, TerminatingWrite};
use tantivy::doc;