From 90d4c1d153541ebabaaa37d09906ab47255c2635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Thu, 15 Oct 2020 16:18:43 +0200 Subject: [PATCH] Simplify the words pair proximity computation --- src/bin/indexer.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/indexer.rs b/src/bin/indexer.rs index 52002f89e..767f7ca0c 100644 --- a/src/bin/indexer.rs +++ b/src/bin/indexer.rs @@ -196,9 +196,8 @@ fn compute_words_pair_proximities( // We don't care about a word that appear at the // same position or too far from the other. if prox >= 1 && prox <= 7 { - match min_prox { - None => min_prox = Some(prox), - Some(mp) => if prox < mp { min_prox = Some(prox) }, + if min_prox.map_or(true, |mp| prox < mp) { + min_prox = Some(prox) } } }