about summary refs log tree commit diff
path: root/indexer/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'indexer/src/main.rs')
-rw-r--r--indexer/src/main.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/indexer/src/main.rs b/indexer/src/main.rs
index 8f12528..e63533b 100644
--- a/indexer/src/main.rs
+++ b/indexer/src/main.rs
@@ -110,7 +110,7 @@ async fn search(data: web::Data<AppState>, term: web::Path<String>) -> impl Resp
     //percentage of valid words
     let mut valid_results: Option<HashSet<CrawledResource>> = None;
     for w in query {
-        let curr_word_results = match search_word_in_db(&database, w) {
+        let curr_word_results = match search_word_in_db(&database, w.to_string()) {
             None => return "[]".to_string(),
             Some(curr_results) => curr_results,
         };
@@ -133,11 +133,11 @@ async fn search(data: web::Data<AppState>, term: web::Path<String>) -> impl Resp
     serde_json::to_string(&valid_results.unwrap()).unwrap()
 }
 
-fn search_word_in_db<'a>(
-    db: &'a HashMap<String, HashSet<CrawledResource>>,
-    word: &'a str,
-) -> Option<&'a HashSet<CrawledResource>> {
-    db.get(word)
+fn search_word_in_db(
+    db: &HashMap<String, HashSet<CrawledResource>>,
+    word: String,
+) -> Option<&HashSet<CrawledResource>> {
+    db.get(&word)
 }
 
 //TODO!