fix the returned error when asc desc fails to be parsed

This commit is contained in:
Tamo 2021-09-22 11:37:05 +02:00
parent fe9f380993
commit 78b0bce9a1
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69

View File

@ -156,7 +156,7 @@ impl FromStr for AscDesc {
match text.rsplit_once(':') { match text.rsplit_once(':') {
Some((left, "asc")) => Ok(AscDesc::Asc(left.parse()?)), Some((left, "asc")) => Ok(AscDesc::Asc(left.parse()?)),
Some((left, "desc")) => Ok(AscDesc::Desc(left.parse()?)), Some((left, "desc")) => Ok(AscDesc::Desc(left.parse()?)),
_ => Err(UserError::InvalidRankingRuleName { name: text.to_string() }), _ => Err(UserError::InvalidAscDescSyntax { name: text.to_string() }),
} }
} }
} }