summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpetr-tik <petr-tik@users.noreply.github.com>2019-09-08 22:36:04 +0100
committerPaul Masurel <paul.masurel@gmail.com>2019-09-09 06:36:04 +0900
commit2ec19b21ae5d9cf27650ecc74d71120d7914c4d4 (patch)
tree419395a69186d818a895af37140226665434eb95
parent141f5a93f706efe248d995548460ac42758c2e0d (diff)
Remove unnecessary duplicate methods (#650)
Closes #649 Spotted by @imor
-rw-r--r--src/postings/serializer.rs5
-rw-r--r--src/schema/index_record_option.rs16
2 files changed, 1 insertions, 20 deletions
diff --git a/src/postings/serializer.rs b/src/postings/serializer.rs
index 9fedc52..79e362a 100644
--- a/src/postings/serializer.rs
+++ b/src/postings/serializer.rs
@@ -141,10 +141,7 @@ impl<'a> FieldSerializer<'a> {
FieldType::Str(ref text_options) => {
if let Some(text_indexing_options) = text_options.get_indexing_options() {
let index_option = text_indexing_options.index_option();
- (
- index_option.is_termfreq_enabled(),
- index_option.is_position_enabled(),
- )
+ (index_option.has_freq(), index_option.has_positions())
} else {
(false, false)
}
diff --git a/src/schema/index_record_option.rs b/src/schema/index_record_option.rs
index 4a595a8..06dc026 100644
--- a/src/schema/index_record_option.rs
+++ b/src/schema/index_record_option.rs
@@ -29,22 +29,6 @@ pub enum IndexRecordOption {
}
impl IndexRecordOption {
- /// Returns true iff the term frequency will be encoded.
- pub fn is_termfreq_enabled(self) -> bool {
- match self {
- IndexRecordOption::WithFreqsAndPositions | IndexRecordOption::WithFreqs => true,
- _ => false,
- }
- }
-
- /// Returns true iff the term positions within the document are stored as well.
- pub fn is_position_enabled(self) -> bool {
- match self {
- IndexRecordOption::WithFreqsAndPositions => true,
- _ => false,
- }
- }
-
/// Returns true iff this option includes encoding
/// term frequencies.
pub fn has_freq(self) -> bool {