From 9fe26c4fdd2e9536dee772d0b1db5d01a7b2f3b2 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Mon, 22 Feb 2021 11:02:04 +0900 Subject: [PATCH] Added 'static to FastValue. --- src/collector/filter_collector_wrapper.rs | 6 +++--- src/collector/top_score_collector.rs | 4 ++-- src/fastfield/mod.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/collector/filter_collector_wrapper.rs b/src/collector/filter_collector_wrapper.rs index 907fc6510..1fe69dc66 100644 --- a/src/collector/filter_collector_wrapper.rs +++ b/src/collector/filter_collector_wrapper.rs @@ -90,7 +90,7 @@ impl Collector where TCollector: Collector + Send + Sync, TPredicate: 'static + Fn(TPredicateValue) -> bool + Send + Sync, - TPredicateValue: 'static + FastValue, + TPredicateValue: FastValue, { // That's the type of our result. // Our standard deviation will be a float. @@ -153,7 +153,7 @@ where pub struct FilterSegmentCollector where TPredicate: 'static, - TPredicateValue: 'static + FastValue, + TPredicateValue: FastValue, { fast_field_reader: FastFieldReader, segment_collector: TSegmentCollector, @@ -166,7 +166,7 @@ impl SegmentCollector where TSegmentCollector: SegmentCollector, TPredicate: 'static + Fn(TPredicateValue) -> bool + Send + Sync, - TPredicateValue: 'static + FastValue, + TPredicateValue: FastValue, { type Fruit = TSegmentCollector::Fruit; diff --git a/src/collector/top_score_collector.rs b/src/collector/top_score_collector.rs index f58095b21..45ba24cf4 100644 --- a/src/collector/top_score_collector.rs +++ b/src/collector/top_score_collector.rs @@ -29,7 +29,7 @@ struct FastFieldConvertCollector< impl Collector for FastFieldConvertCollector where TCollector: Collector>, - TFastValue: FastValue + 'static, + TFastValue: FastValue, { type Fruit = Vec<(TFastValue, DocAddress)>; @@ -361,7 +361,7 @@ impl TopDocs { fast_field: Field, ) -> impl Collector> where - TFastValue: FastValue + 'static, + TFastValue: FastValue, { let u64_collector = self.order_by_u64_field(fast_field); FastFieldConvertCollector { diff --git a/src/fastfield/mod.rs b/src/fastfield/mod.rs index f7e9348d4..b24495ad4 100644 --- a/src/fastfield/mod.rs +++ b/src/fastfield/mod.rs @@ -53,7 +53,7 @@ mod serializer; mod writer; /// Trait for types that are allowed for fast fields: (u64, i64 and f64). -pub trait FastValue: Clone + Copy + Send + Sync + PartialOrd { +pub trait FastValue: Clone + Copy + Send + Sync + PartialOrd + 'static { /// Converts a value from u64 /// /// Internally all fast field values are encoded as u64.