aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-16 01:57:11 -0700
committerFuwn <[email protected]>2022-04-16 01:57:11 -0700
commitbf5a6841ffeb29ffcf718b8fbf80fea91074c58e (patch)
treebd529f566412f92b6f4f609832252874acee422a /src/main.rs
parentfeat: add explicit licensing terms (diff)
downloadlocus-bf5a6841ffeb29ffcf718b8fbf80fea91074c58e.tar.xz
locus-bf5a6841ffeb29ffcf718b8fbf80fea91074c58e.zip
refactor: route for future use
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index c848fb0..f926faf 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -60,7 +60,7 @@ static DATABASE: SyncLazy<Mutex<PickleDb>> = SyncLazy::new(|| {
}
})
});
-static ROUTES: SyncLazy<Mutex<HashMap<String, String>>> =
+static ROUTES: SyncLazy<Mutex<HashMap<String, route::Route>>> =
SyncLazy::new(|| Mutex::new(HashMap::new()));
#[derive(Template)]
@@ -160,7 +160,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"# SITEMAP\n\n{}",
(*ROUTES.lock().unwrap())
.iter()
- .map(|(r, d)| format!("=> {} {}", r, d))
+ .map(|(r, d)| format!("=> {} {}", r, d.description))
.collect::<Vec<_>>()
.join("\n")
),
@@ -187,7 +187,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let results = (*ROUTES.lock().unwrap())
.iter()
- .map(|(r, d)| format!("=> {} {}", r, d))
+ .map(|(r, d)| format!("=> {} {}", r, d.description))
.filter(|r| r.to_lowercase().contains(&query.0.to_string()))
.collect::<Vec<_>>()
.join("\n");