fix issue on ranking rules

This commit is contained in:
Quentin de Quelen 2020-01-18 19:00:19 +01:00 committed by qdequele
parent e078eafb1f
commit 7a6f583b1f
No known key found for this signature in database
GPG Key ID: B3F0A000EBF11745

View File

@ -40,9 +40,9 @@ impl Into<SettingsUpdate> for Settings {
"_exact" => RankingRule::Exact,
_ => {
let captures = RANKING_RULE_REGEX.lock().unwrap().captures(&rule).unwrap();
match captures[0].as_ref() {
"asc" => RankingRule::Asc(captures[1].to_string()),
"dsc" => RankingRule::Dsc(captures[1].to_string()),
match captures[1].as_ref() {
"asc" => RankingRule::Asc(captures[2].to_string()),
"dsc" => RankingRule::Dsc(captures[2].to_string()),
_ => continue
}
}