From 7102b363f527a46569ada08ddb9cdfb5f66f2acc Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Sun, 5 May 2019 14:17:52 +0900 Subject: [PATCH] Fix build --- examples/custom_collector.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/custom_collector.rs b/examples/custom_collector.rs index 444534c31..0497542d0 100644 --- a/examples/custom_collector.rs +++ b/examples/custom_collector.rs @@ -18,8 +18,8 @@ use tantivy::fastfield::FastFieldReader; use tantivy::query::QueryParser; use tantivy::schema::Field; use tantivy::schema::{Schema, FAST, INDEXED, TEXT}; -use tantivy::{Index, TantivyError}; use tantivy::SegmentReader; +use tantivy::{Index, TantivyError}; #[derive(Default)] struct Stats { @@ -81,8 +81,11 @@ impl Collector for StatsCollector { .fast_fields() .u64(self.field) .ok_or_else(|| { - let field_name = segment_reader.schema().get_field_name() - TantivyError::SchemaError(format!("Field {:?} is not a u64 fast field.", field_name)) + let field_name = segment_reader.schema().get_field_name(self.field); + TantivyError::SchemaError(format!( + "Field {:?} is not a u64 fast field.", + field_name + )) })?; Ok(StatsSegmentCollector { fast_field_reader,