From d510178127a6571afb4d643b87abc811fcdc3b0d Mon Sep 17 00:00:00 2001 From: Alex Wellnitz Date: Tue, 13 Feb 2024 08:36:32 +0100 Subject: [PATCH] refactor: make update_url_scores and normalize_string functions private --- src/search/engine.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search/engine.rs b/src/search/engine.rs index fdbcb85..2aca69e 100644 --- a/src/search/engine.rs +++ b/src/search/engine.rs @@ -1,13 +1,13 @@ use std::collections::HashMap; use std::f64; -pub fn update_url_scores(old: &mut HashMap, new: &HashMap) { +fn update_url_scores(old: &mut HashMap, new: &HashMap) { for (url, score) in new { old.entry(url.to_string()).and_modify(|e| *e += score).or_insert(*score); } } -pub fn normalize_string(input_string: &str) -> String { +fn normalize_string(input_string: &str) -> String { let string_without_punc: String = input_string.chars().filter(|&c| !c.is_ascii_punctuation()).collect(); let string_without_double_spaces: String = string_without_punc.split_whitespace().collect::>().join(" "); string_without_double_spaces.to_lowercase()