caio.co/de/cantine

Automated `cargo fmt` run

Id
42bfcea38b99c6e341bcd390a74523a1a80740f1
Author
Caio
Commit time
2021-02-17T11:30:49+01:00

Modified cantine_derive/src/lib.rs

@@ -202,7 +202,11

use std::{convert::TryInto, ops::Range};

- use tantivy::{Document, Index, query::AllQuery, schema::{self, SchemaBuilder}};
+ use tantivy::{
+ query::AllQuery,
+ schema::{self, SchemaBuilder},
+ Document, Index,
+ };

// XXX Who will test the tests?
impl Aggregator<Vec<Range<i16>>, i16> for Vec<i16> {

Modified tique/src/topterms.rs

@@ -282,7 +282,12
termfreq
}

-fn termfreq_for_doc<F>(searcher: &Searcher, field: Field, doc: DocAddress, mut consumer: F) -> Result<()>
+fn termfreq_for_doc<F>(
+ searcher: &Searcher,
+ field: Field,
+ doc: DocAddress,
+ mut consumer: F,
+) -> Result<()>
where
F: FnMut(Term, u32),
{
@@ -294,8 +299,8

while let Some((bytes, terminfo)) = termstream.next() {
if let Ok(text) = str::from_utf8(bytes) {
- let mut postings =
- inverted_index.read_postings_from_terminfo(terminfo, IndexRecordOption::WithFreqs)?;
+ let mut postings = inverted_index
+ .read_postings_from_terminfo(terminfo, IndexRecordOption::WithFreqs)?;

// XXX SegmentPostings::seek crashes debug builds when the target
// is before the current position
@@ -369,9 +374,12
let text_termfreq = termfreq(&text, body, &index.tokenizer_for_field(body)?);

let reader = index.reader()?;
- assert!(termfreq_for_doc(&reader.searcher(), body, DocAddress(0, 0), |term, tf| {
- assert_eq!(Some(&tf), text_termfreq.get(&term));
- }).is_ok());
+ assert!(
+ termfreq_for_doc(&reader.searcher(), body, DocAddress(0, 0), |term, tf| {
+ assert_eq!(Some(&tf), text_termfreq.get(&term));
+ })
+ .is_ok()
+ );

Ok(())
}