mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-10 11:02:55 +00:00
Fixing compilation warnings & clippy comments.
This commit is contained in:
@@ -727,7 +727,7 @@ mod bench {
|
||||
|
||||
let mut index_writer = index.writer_for_tests().unwrap();
|
||||
for doc in docs {
|
||||
index_writer.add_document(doc);
|
||||
index_writer.add_document(doc).unwrap();
|
||||
}
|
||||
index_writer.commit().unwrap();
|
||||
let reader = index.reader().unwrap();
|
||||
|
||||
@@ -516,7 +516,7 @@ mod bench_sorted_index_merge {
|
||||
let index_doc = |index_writer: &mut IndexWriter, val: u64| {
|
||||
let mut doc = Document::default();
|
||||
doc.add_u64(int_field, val);
|
||||
index_writer.add_document(doc);
|
||||
index_writer.add_document(doc).unwrap();
|
||||
};
|
||||
// 3 segments with 10_000 values in the fast fields
|
||||
for _ in 0..3 {
|
||||
|
||||
@@ -617,7 +617,7 @@ mod bench {
|
||||
doc.add_text(text_field, "c");
|
||||
}
|
||||
doc.add_text(text_field, "d");
|
||||
index_writer.add_document(doc);
|
||||
index_writer.add_document(doc).unwrap();
|
||||
}
|
||||
assert!(index_writer.commit().is_ok());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ use std::io;
|
||||
|
||||
#[inline]
|
||||
pub fn compress(mut uncompressed: &[u8], compressed: &mut Vec<u8>) -> io::Result<()> {
|
||||
let mut params = brotli::enc::BrotliEncoderParams::default();
|
||||
params.quality = 5;
|
||||
let params = brotli::enc::BrotliEncoderParams {
|
||||
quality: 5,
|
||||
..Default::default()
|
||||
};
|
||||
compressed.clear();
|
||||
brotli::BrotliCompress(&mut uncompressed, compressed, ¶ms)?;
|
||||
Ok(())
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::io::{self, Read, Write};
|
||||
pub fn compress(uncompressed: &[u8], compressed: &mut Vec<u8>) -> io::Result<()> {
|
||||
compressed.clear();
|
||||
let mut encoder = snap::write::FrameEncoder::new(compressed);
|
||||
encoder.write_all(&uncompressed)?;
|
||||
encoder.write_all(uncompressed)?;
|
||||
encoder.flush()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -259,11 +259,11 @@ pub mod tests {
|
||||
let mut index_writer = index.writer_for_tests().unwrap();
|
||||
// put enough data create enough blocks in the doc store to be considered for stacking
|
||||
for _ in 0..200 {
|
||||
index_writer.add_document(doc!(text_field=> LOREM));
|
||||
index_writer.add_document(doc!(text_field=> LOREM))?;
|
||||
}
|
||||
assert!(index_writer.commit().is_ok());
|
||||
for _ in 0..200 {
|
||||
index_writer.add_document(doc!(text_field=> LOREM));
|
||||
index_writer.add_document(doc!(text_field=> LOREM))?;
|
||||
}
|
||||
assert!(index_writer.commit().is_ok());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user