diff options
author | Kornel <kornel@geekhood.net> | 2019-04-14 02:05:15 +0100 |
---|---|---|
committer | Kornel <kornel@geekhood.net> | 2019-04-14 02:12:34 +0100 |
commit | 7ee6f091ff586ce5a742472cb6e6a6efeb353943 (patch) | |
tree | 28535b781f1954fe331e08ba4004318c832e670c /categories/src | |
parent | 3b337e1a2ee3510862f7267372595c1ee3547e51 (diff) |
Unwrap
Diffstat (limited to 'categories/src')
-rw-r--r-- | categories/src/tuning.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/categories/src/tuning.rs b/categories/src/tuning.rs index e8ffabb..20148db 100644 --- a/categories/src/tuning.rs +++ b/categories/src/tuning.rs @@ -982,7 +982,7 @@ pub fn adjusted_relevance(mut candidates: HashMap<String, f64>, keywords: HashSe let max_score = candidates.iter() .map(|(_, v)| *v) - .max_by(|a, b| a.partial_cmp(&b).unwrap()) + .max_by(|a, b| a.partial_cmp(&b).expect("nan")) .unwrap_or(0.); let min_category_match_threshold = min_category_match_threshold.max(max_score * 0.951); @@ -993,7 +993,7 @@ pub fn adjusted_relevance(mut candidates: HashMap<String, f64>, keywords: HashSe .take(max_num_categories) .map(|(k, v)| (v, k)) .collect(); - res.sort_by(|a, b| b.0.partial_cmp(&a.0).unwrap()); + res.sort_by(|a, b| b.0.partial_cmp(&a.0).expect("nan")); res } |