aboutsummaryrefslogtreecommitdiff
path: root/src/route.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-27 01:17:32 -0700
committerFuwn <[email protected]>2022-04-27 01:17:32 -0700
commitc81eab0c3b4fa8d8433505bd3d061f8de8e87d74 (patch)
tree09451b5ebec415295d63504e9eaffecb37277a68 /src/route.rs
parentrefactor(modules): move search out of module (diff)
downloadlocus-c81eab0c3b4fa8d8433505bd3d061f8de8e87d74.tar.xz
locus-c81eab0c3b4fa8d8433505bd3d061f8de8e87d74.zip
refactor: restrict more
Diffstat (limited to 'src/route.rs')
-rw-r--r--src/route.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/route.rs b/src/route.rs
index 285d049..032381d 100644
--- a/src/route.rs
+++ b/src/route.rs
@@ -16,17 +16,18 @@
// Copyright (C) 2022-2022 Fuwn <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only
-use std::{lazy::SyncLazy, sync::Mutex};
+use std::{collections::HashMap, lazy::SyncLazy, sync::Mutex};
use tokio::time::Instant;
-use crate::ROUTES;
-
#[cfg(debug_assertions)]
pub const CACHE_RATE: u64 = 1;
#[cfg(not(debug_assertions))]
pub const CACHE_RATE: u64 = 60 * 5;
+pub static ROUTES: SyncLazy<Mutex<HashMap<String, Route>>> =
+ SyncLazy::new(|| Mutex::new(HashMap::new()));
+
#[derive(Debug)]
pub struct Route {
pub description: String,