From 78f3a233ca24d4df123f2da35897f3e5eec50fc8 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 18 Apr 2022 04:17:35 -0700 Subject: refactor: constify many constants --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index d529f5c..044002e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,7 +46,7 @@ use tokio::time::Instant; use windmark::{Response, Router}; use yarte::Template; -const CACHE_RATE: u64 = 60 * 5; +const SEARCH_SIZE: usize = 10; static DATABASE: SyncLazy> = SyncLazy::new(|| { Mutex::new({ @@ -209,7 +209,7 @@ async fn main() -> Result<(), Box> { ) .parse_query(&query.0.to_string()) .unwrap(), - &tantivy::collector::TopDocs::with_limit(10), + &tantivy::collector::TopDocs::with_limit(SEARCH_SIZE), ) .unwrap(); -- cgit v1.2.3