aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-07 23:37:13 +0000
committerFuwn <[email protected]>2024-06-07 23:37:13 +0000
commit7a4276e2b165370f8cf4d740ef067223ab3b84b3 (patch)
treee402a19e7f46a955282202e980bc3af9a8a698da /src
parentdocs(cargo): bump version (diff)
downloadseptember-7a4276e2b165370f8cf4d740ef067223ab3b84b3.tar.xz
september-7a4276e2b165370f8cf4d740ef067223ab3b84b3.zip
refactor(url): use unwrap instead of map
Diffstat (limited to 'src')
-rw-r--r--src/url.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/url.rs b/src/url.rs
index e004696..1784be6 100644
--- a/src/url.rs
+++ b/src/url.rs
@@ -66,17 +66,14 @@ pub fn from_path(
format!(
"{}{}{}",
{
- std::env::var("ROOT").map_or_else(
- |_| {
- warn!(
- "could not use ROOT from environment variables, proceeding \
- with default root: gemini://fuwn.me"
- );
+ std::env::var("ROOT").unwrap_or_else(|_| {
+ warn!(
+ "could not use ROOT from environment variables, proceeding with \
+ default root: gemini://fuwn.me"
+ );
- "gemini://fuwn.me".to_string()
- },
- |root| root,
- )
+ "gemini://fuwn.me".to_string()
+ })
},
path,
if fallback { "/" } else { "" }