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
commiteeabaeef1ebf242e2d79a226ea06b4bbe6421086 (patch)
tree647a0bc69f5f626614d4417a77008c93c48c1e52 /src
parentdocs(cargo): bump version (diff)
downloadseptember-eeabaeef1ebf242e2d79a226ea06b4bbe6421086.tar.xz
september-eeabaeef1ebf242e2d79a226ea06b4bbe6421086.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 { "" }