delete the invalid criterion name error in favor of invalid ranking rule name

This commit is contained in:
Tamo 2021-09-08 19:17:00 +02:00
parent bad8ea47d5
commit c81ff22c5b
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69
2 changed files with 2 additions and 4 deletions

View File

@ -59,10 +59,10 @@ impl FromStr for Criterion {
Err(UserError::InvalidRankingRuleName { name: text.to_string() })? Err(UserError::InvalidRankingRuleName { name: text.to_string() })?
} }
Err(UserError::InvalidAscDescSyntax { name }) => { Err(UserError::InvalidAscDescSyntax { name }) => {
Err(UserError::InvalidCriterionName { name }.into()) Err(UserError::InvalidRankingRuleName { name }.into())
} }
Err(error) => { Err(error) => {
Err(UserError::InvalidCriterionName { name: error.to_string() }.into()) Err(UserError::InvalidRankingRuleName { name: error.to_string() }.into())
} }
}, },
} }

View File

@ -60,7 +60,6 @@ pub enum UserError {
Csv(csv::Error), Csv(csv::Error),
DocumentLimitReached, DocumentLimitReached,
InvalidAscDescSyntax { name: String }, InvalidAscDescSyntax { name: String },
InvalidCriterionName { name: String },
InvalidDocumentId { document_id: Value }, InvalidDocumentId { document_id: Value },
InvalidFacetsDistribution { invalid_facets_name: HashSet<String> }, InvalidFacetsDistribution { invalid_facets_name: HashSet<String> },
InvalidFilter(pest::error::Error<ParserRule>), InvalidFilter(pest::error::Error<ParserRule>),
@ -230,7 +229,6 @@ impl fmt::Display for UserError {
Self::InvalidAscDescSyntax { name } => { Self::InvalidAscDescSyntax { name } => {
write!(f, "invalid asc/desc syntax for {}", name) write!(f, "invalid asc/desc syntax for {}", name)
} }
Self::InvalidCriterionName { name } => write!(f, "invalid criterion {}", name),
Self::InvalidGeoField { document_id, object } => write!( Self::InvalidGeoField { document_id, object } => write!(
f, f,
"the document with the id: {} contains an invalid _geo field: {}", "the document with the id: {} contains an invalid _geo field: {}",