diff options
Diffstat (limited to 'src/route.rs')
| -rw-r--r-- | src/route.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/route.rs b/src/route.rs index 66d09cc..1c4b128 100644 --- a/src/route.rs +++ b/src/route.rs @@ -16,6 +16,19 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only +pub struct Route { + pub description: String, + pub text_cache: String, +} +impl Route { + pub fn new(description: &str) -> Self { + Self { + description: description.to_string(), + text_cache: "".to_string(), + } + } +} + pub fn hits_from(route: &str) -> i32 { if let Ok(database) = crate::DATABASE.lock() { (*database) @@ -33,6 +46,6 @@ pub fn track_mount( handler: windmark::handler::RouteResponse, ) { (*crate::ROUTES.lock().unwrap()) - .insert(route.to_string(), description.to_string()); + .insert(route.to_string(), Route::new(description)); router.mount(route, handler); } |