diff options
| author | Fuwn <[email protected]> | 2023-02-04 02:01:43 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-02-04 02:01:43 +0000 |
| commit | 1cfa3421e55c28dd9e7a88a53e4669f25e486bd4 (patch) | |
| tree | 3199eccf8e04cb9ba9205bbb3c52502e3d5694a3 /src/main.rs | |
| parent | fix(gemini_to_html.rs): html entity-encode gemini (diff) | |
| download | september-1cfa3421e55c28dd9e7a88a53e4669f25e486bd4.tar.xz september-1cfa3421e55c28dd9e7a88a53e4669f25e486bd4.zip | |
build(rustup): move from nightly to stable)
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs index 3b6f740..a5c5330 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,19 +64,15 @@ async fn main() -> std::io::Result<()> { "0.0.0.0", // If the `PORT` environment variable is present, try to use it, otherwise; // use port `80`. - if let Ok(port) = var("PORT") { - match port.parse::<_>() { - Ok(port) => port, - Err(e) => { - warn!("could not use PORT from environment variables: {}", e); - warn!("proceeding with default port: 80"); + var("PORT").map_or(80, |port| match port.parse::<_>() { + Ok(port) => port, + Err(e) => { + warn!("could not use PORT from environment variables: {}", e); + warn!("proceeding with default port: 80"); - 80 - } + 80 } - } else { - 80 - }, + }), ))? .run() .await |