aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorboastful-squirrel <boastful.squirrel@gmail.com>2019-04-25 16:41:05 +0000
committerboastful-squirrel <boastful.squirrel@gmail.com>2019-04-25 16:41:05 +0000
commitb223d7dff4f70e85695c5641db932944db4dc774 (patch)
treea6de481eaf136eb9d5c739e99c14cae349c5c01a /src/main.rs
parentMade code more idiomatic (diff)
parentMerge pull request #82 from svenstaro/dependabot/cargo/pretty_assertions-0.6.1 (diff)
downloadminiserve-b223d7dff4f70e85695c5641db932944db4dc774.tar.gz
miniserve-b223d7dff4f70e85695c5641db932944db4dc774.zip
Merge branch 'master' into no_panics
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 59e5f1d..cf7ca93 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -241,9 +241,10 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
let random_route = app.state().random_route.clone();
let default_color_scheme = app.state().default_color_scheme.clone();
let file_upload = app.state().file_upload;
- upload_route = match app.state().random_route.clone() {
- Some(random_route) => format!("/{}/upload", random_route),
- None => "/upload".to_string(),
+ upload_route = if let Some(random_route) = app.state().random_route.clone() {
+ format!("/{}/upload", random_route)
+ } else {
+ "/upload".to_string()
};
if path.is_file() {
None