mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-26 20:19:57 +00:00
Updating rustc-hash and clippy fixes (#2532)
* Updating rustc-hash and clippy fixes * fix terms_aggregation_min_doc_count_special_case --------- Co-authored-by: Pascal Seitz <pascal.seitz@gmail.com>
This commit is contained in:
@@ -43,7 +43,7 @@ bitpacking = { version = "0.9.2", default-features = false, features = [
|
|||||||
"bitpacker4x",
|
"bitpacker4x",
|
||||||
] }
|
] }
|
||||||
census = "0.4.2"
|
census = "0.4.2"
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "2.0.0"
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.30"
|
||||||
htmlescape = "0.3.1"
|
htmlescape = "0.3.1"
|
||||||
fail = { version = "0.5.0", optional = true }
|
fail = { version = "0.5.0", optional = true }
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const IMPLS: [FilterImplPerInstructionSet; 1] = [FilterImplPerInstructionSet::Sc
|
|||||||
|
|
||||||
impl FilterImplPerInstructionSet {
|
impl FilterImplPerInstructionSet {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[allow(unused_variables)] // on non-x86_64, code is unused.
|
||||||
fn from(code: u8) -> FilterImplPerInstructionSet {
|
fn from(code: u8) -> FilterImplPerInstructionSet {
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
if code == FilterImplPerInstructionSet::AVX2 as u8 {
|
if code == FilterImplPerInstructionSet::AVX2 as u8 {
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ impl<T> From<T> for ColumnOperation<T> {
|
|||||||
// In order to limit memory usage, and in order
|
// In order to limit memory usage, and in order
|
||||||
// to benefit from the stacker, we do this by serialization our data
|
// to benefit from the stacker, we do this by serialization our data
|
||||||
// as "Symbols".
|
// as "Symbols".
|
||||||
#[expect(clippy::from_over_into)]
|
|
||||||
pub(super) trait SymbolValue: Clone + Copy {
|
pub(super) trait SymbolValue: Clone + Copy {
|
||||||
// Serializes the symbol into the given buffer.
|
// Serializes the symbol into the given buffer.
|
||||||
// Returns the number of bytes written into the buffer.
|
// Returns the number of bytes written into the buffer.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ pub use datetime::{DateTime, DateTimePrecision};
|
|||||||
pub use group_by::GroupByIteratorExtended;
|
pub use group_by::GroupByIteratorExtended;
|
||||||
pub use json_path_writer::JsonPathWriter;
|
pub use json_path_writer::JsonPathWriter;
|
||||||
pub use ownedbytes::{OwnedBytes, StableDeref};
|
pub use ownedbytes::{OwnedBytes, StableDeref};
|
||||||
pub use serialize::*;
|
pub use serialize::{BinarySerializable, DeserializeFrom, FixedSize};
|
||||||
pub use vint::{
|
pub use vint::{
|
||||||
read_u32_vint, read_u32_vint_no_advance, serialize_vint_u32, write_u32_vint, VInt, VIntU128,
|
read_u32_vint, read_u32_vint_no_advance, serialize_vint_u32, write_u32_vint, VInt, VIntU128,
|
||||||
};
|
};
|
||||||
@@ -134,7 +134,7 @@ pub(crate) mod test {
|
|||||||
|
|
||||||
use proptest::prelude::*;
|
use proptest::prelude::*;
|
||||||
|
|
||||||
use super::{f64_to_u64, i64_to_u64, u64_to_f64, u64_to_i64, BinarySerializable, FixedSize};
|
use super::{f64_to_u64, i64_to_u64, u64_to_f64, u64_to_i64};
|
||||||
|
|
||||||
fn test_i64_converter_helper(val: i64) {
|
fn test_i64_converter_helper(val: i64) {
|
||||||
assert_eq!(u64_to_i64(i64_to_u64(val)), val);
|
assert_eq!(u64_to_i64(i64_to_u64(val)), val);
|
||||||
@@ -144,12 +144,6 @@ pub(crate) mod test {
|
|||||||
assert_eq!(u64_to_f64(f64_to_u64(val)), val);
|
assert_eq!(u64_to_f64(f64_to_u64(val)), val);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn fixed_size_test<O: BinarySerializable + FixedSize + Default>() {
|
|
||||||
let mut buffer = Vec::new();
|
|
||||||
O::default().serialize(&mut buffer).unwrap();
|
|
||||||
assert_eq!(buffer.len(), O::SIZE_IN_BYTES);
|
|
||||||
}
|
|
||||||
|
|
||||||
proptest! {
|
proptest! {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_f64_converter_monotonicity_proptest((left, right) in (proptest::num::f64::NORMAL, proptest::num::f64::NORMAL)) {
|
fn test_f64_converter_monotonicity_proptest((left, right) in (proptest::num::f64::NORMAL, proptest::num::f64::NORMAL)) {
|
||||||
|
|||||||
@@ -1232,8 +1232,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn terms_aggregation_min_doc_count_special_case() -> crate::Result<()> {
|
fn terms_aggregation_min_doc_count_special_case() -> crate::Result<()> {
|
||||||
let terms_per_segment = vec![
|
let terms_per_segment = vec![
|
||||||
vec!["terma", "terma", "termb", "termb", "termb", "termc"],
|
vec!["terma", "terma", "termb", "termb", "termb"],
|
||||||
vec!["terma", "terma", "termb", "termc", "termc"],
|
vec!["terma", "terma", "termb"],
|
||||||
];
|
];
|
||||||
|
|
||||||
let index = get_test_index_from_terms(false, &terms_per_segment)?;
|
let index = get_test_index_from_terms(false, &terms_per_segment)?;
|
||||||
@@ -1255,8 +1255,6 @@ mod tests {
|
|||||||
assert_eq!(res["my_texts"]["buckets"][0]["doc_count"], 4);
|
assert_eq!(res["my_texts"]["buckets"][0]["doc_count"], 4);
|
||||||
assert_eq!(res["my_texts"]["buckets"][1]["key"], "termb");
|
assert_eq!(res["my_texts"]["buckets"][1]["key"], "termb");
|
||||||
assert_eq!(res["my_texts"]["buckets"][1]["doc_count"], 0);
|
assert_eq!(res["my_texts"]["buckets"][1]["doc_count"], 0);
|
||||||
assert_eq!(res["my_texts"]["buckets"][2]["key"], "termc");
|
|
||||||
assert_eq!(res["my_texts"]["buckets"][2]["doc_count"], 0);
|
|
||||||
assert_eq!(res["my_texts"]["sum_other_doc_count"], 0);
|
assert_eq!(res["my_texts"]["sum_other_doc_count"], 0);
|
||||||
assert_eq!(res["my_texts"]["doc_count_error_upper_bound"], 0);
|
assert_eq!(res["my_texts"]["doc_count_error_upper_bound"], 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user