diff options
author | Billy Bradley <billy@squeno.com> | 2021-10-15 15:37:13 +0000 |
---|---|---|
committer | Billy Bradley <billy@squeno.com> | 2021-10-15 15:37:13 +0000 |
commit | 784e1e073b65e195844b7bb14e34a5cf68c2f5a4 (patch) | |
tree | 7d9d7393530e8e039aa3e1db1865e1c045cef23b | |
parent | Fix formatting (diff) | |
download | miniserve-784e1e073b65e195844b7bb14e34a5cf68c2f5a4.tar.gz miniserve-784e1e073b65e195844b7bb14e34a5cf68c2f5a4.zip |
Only clone spa_index when necessary
Diffstat (limited to '')
-rw-r--r-- | src/config.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs index 0af19a6..e0d5ec5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -177,7 +177,10 @@ impl MiniserveConfig { let tls_rustls_server_config = None; // If spa_index is set but index is unset, copy the former into the latter - let index = args.index.or(args.spa_index.clone()); + let index = match args.index { + Some(index) => Some(index), + None => args.spa_index.clone(), + }; Ok(MiniserveConfig { verbose: args.verbose, |