Added 'static to FastValue.

This commit is contained in:
Paul Masurel
2021-02-22 11:02:04 +09:00
parent a369a72cae
commit 9fe26c4fdd
3 changed files with 6 additions and 6 deletions

View File

@@ -90,7 +90,7 @@ impl<TCollector, TPredicate, TPredicateValue: FastValue> 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<TSegmentCollector, TPredicate, TPredicateValue>
where
TPredicate: 'static,
TPredicateValue: 'static + FastValue,
TPredicateValue: FastValue,
{
fast_field_reader: FastFieldReader<TPredicateValue>,
segment_collector: TSegmentCollector,
@@ -166,7 +166,7 @@ impl<TSegmentCollector, TPredicate, TPredicateValue> SegmentCollector
where
TSegmentCollector: SegmentCollector,
TPredicate: 'static + Fn(TPredicateValue) -> bool + Send + Sync,
TPredicateValue: 'static + FastValue,
TPredicateValue: FastValue,
{
type Fruit = TSegmentCollector::Fruit;

View File

@@ -29,7 +29,7 @@ struct FastFieldConvertCollector<
impl<TCollector, TFastValue> Collector for FastFieldConvertCollector<TCollector, TFastValue>
where
TCollector: Collector<Fruit = Vec<(u64, DocAddress)>>,
TFastValue: FastValue + 'static,
TFastValue: FastValue,
{
type Fruit = Vec<(TFastValue, DocAddress)>;
@@ -361,7 +361,7 @@ impl TopDocs {
fast_field: Field,
) -> impl Collector<Fruit = Vec<(TFastValue, DocAddress)>>
where
TFastValue: FastValue + 'static,
TFastValue: FastValue,
{
let u64_collector = self.order_by_u64_field(fast_field);
FastFieldConvertCollector {

View File

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