aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-17 06:53:56 -0700
committerFuwn <[email protected]>2024-06-17 06:53:56 -0700
commit90725489b42afac4f96a3f8303de1bbb5c2bd934 (patch)
tree1a919d0f60dfb9dd57f45ab446301743b5191335 /src/modules
parentrefactor: remove file header (diff)
downloadlocus-90725489b42afac4f96a3f8303de1bbb5c2bd934.tar.xz
locus-90725489b42afac4f96a3f8303de1bbb5c2bd934.zip
deps: bump compatible outdated
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/search.rs23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/modules/search.rs b/src/modules/search.rs
index 976f477..bafafed 100644
--- a/src/modules/search.rs
+++ b/src/modules/search.rs
@@ -1,11 +1,12 @@
-use std::{
- fmt::Write,
- sync::{LazyLock, Mutex},
+use {
+ std::{
+ fmt::Write,
+ sync::{LazyLock, Mutex},
+ },
+ tantivy::schema,
+ tempfile::TempDir,
};
-use tantivy::schema;
-use tempfile::TempDir;
-
const SEARCH_INDEX_SIZE: usize = 10_000_000;
const SEARCH_SIZE: usize = 10;
@@ -84,11 +85,7 @@ pub(super) fn module(router: &mut windmark::router::Router) {
macro_rules! text {
($field:ident) => {{
- retrieved_document
- .get_first($field)
- .unwrap()
- .as_text()
- .unwrap()
+ retrieved_document.get_first($field).unwrap().as_text().unwrap()
}}; /* ($document:ident, $field:ident) => {{
* $document.get_first($field).unwrap().as_text().
* unwrap() }}; */
@@ -161,9 +158,7 @@ pub fn index() {
for (route_path, information) in &(*crate::route::ROUTES.lock().unwrap()) {
// Pretty inefficient, but I'll figure this out later.
- (*INDEX_WRITER.lock().unwrap())
- .delete_all_documents()
- .unwrap();
+ (*INDEX_WRITER.lock().unwrap()).delete_all_documents().unwrap();
(*INDEX_WRITER.lock().unwrap())
.add_document(tantivy::doc!(