diff options
| author | Fuwn <[email protected]> | 2022-04-01 02:48:00 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-04-01 02:48:00 -0700 |
| commit | 5caf0413bce698288c61e1491d11b3ca4d11d551 (patch) | |
| tree | 484857cfcc1f04dc786230ef027a623a543d4554 /src | |
| parent | fix(database): always use trailing slash root (diff) | |
| download | locus-5caf0413bce698288c61e1491d11b3ca4d11d551.tar.xz locus-5caf0413bce698288c61e1491d11b3ca4d11d551.zip | |
format: rust fmt
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 74f613f..be00227 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,10 +93,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { url.to_string(), ); - let mut url_path = url.path(); - if url.path().is_empty() { - url_path = "/"; - } + let url_path = if url.path().is_empty() { + "/" + } else { + url.path() + }; let previous_database = (*DATABASE.lock().unwrap()).get::<i32>(url_path); |