diff options
| author | Fuwn <[email protected]> | 2024-03-05 05:59:27 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-03-05 05:59:27 -0800 |
| commit | 30f80c85b9ed4cb6a4a633e1bc7a3dbd142f8547 (patch) | |
| tree | 53433b0acade861f6d5e8f8a308d6208199d5ce2 /src/route.rs | |
| parent | ci(earthly): switch to earthly from docker (diff) | |
| download | locus-30f80c85b9ed4cb6a4a633e1bc7a3dbd142f8547.tar.xz locus-30f80c85b9ed4cb6a4a633e1bc7a3dbd142f8547.zip | |
format: new rustfmt.toml
Diffstat (limited to 'src/route.rs')
| -rw-r--r-- | src/route.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/route.rs b/src/route.rs index 8d7695d..27cdc0f 100644 --- a/src/route.rs +++ b/src/route.rs @@ -37,18 +37,13 @@ pub struct Route { } impl Route { pub fn new(description: &str) -> Self { - Self { - description: description.to_string(), - text_cache: String::new(), - } + Self { description: description.to_string(), text_cache: String::new() } } } pub fn hits_from(route: &str) -> i32 { crate::DATABASE.lock().map_or(0, |database| { - (*database) - .get::<i32>(if route.is_empty() { "/" } else { route }) - .unwrap() + (*database).get::<i32>(if route.is_empty() { "/" } else { route }).unwrap() }) } |