aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/random.rs2
-rw-r--r--src/modules/search.rs5
-rw-r--r--src/modules/sitemap.rs2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/random.rs b/src/modules/random.rs
index 8604d64..799376a 100644
--- a/src/modules/random.rs
+++ b/src/modules/random.rs
@@ -25,7 +25,7 @@ pub fn module(router: &mut windmark::Router) {
"Get redirected to a random route",
Box::new(|_| {
windmark::Response::TemporaryRedirect(
- (*crate::ROUTES.lock().unwrap())
+ (*crate::route::ROUTES.lock().unwrap())
.iter()
.collect::<Vec<_>>()
.choose(&mut rand::thread_rng())
diff --git a/src/modules/search.rs b/src/modules/search.rs
index 57f2c0c..15d0061 100644
--- a/src/modules/search.rs
+++ b/src/modules/search.rs
@@ -22,6 +22,7 @@ use tantivy::schema;
use tempfile::TempDir;
const SEARCH_INDEX_SIZE: usize = 10_000_000;
+const SEARCH_SIZE: usize = 10;
static INDEX_PATH: SyncLazy<Mutex<TempDir>> =
SyncLazy::new(|| Mutex::new(TempDir::new().unwrap()));
@@ -89,7 +90,7 @@ pub(super) fn module(router: &mut windmark::Router) {
)
.parse_query(&query.0.to_string())
.unwrap(),
- &tantivy::collector::TopDocs::with_limit(crate::SEARCH_SIZE),
+ &tantivy::collector::TopDocs::with_limit(SEARCH_SIZE),
)
.unwrap();
@@ -170,7 +171,7 @@ pub fn index() {
let time = tokio::time::Instant::now();
let mut new = 0;
- for (route_path, information) in &(*crate::ROUTES.lock().unwrap()) {
+ 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()
diff --git a/src/modules/sitemap.rs b/src/modules/sitemap.rs
index b0a29d2..d9f94a5 100644
--- a/src/modules/sitemap.rs
+++ b/src/modules/sitemap.rs
@@ -25,7 +25,7 @@ pub fn module(router: &mut windmark::Router) {
crate::success!(
format!(
"# SITEMAP\n\n{}",
- (*crate::ROUTES.lock().unwrap())
+ (*crate::route::ROUTES.lock().unwrap())
.iter()
.map(|(r, d)| format!("=> {} {}", r, d.description))
.collect::<Vec<_>>()