From 784e1e073b65e195844b7bb14e34a5cf68c2f5a4 Mon Sep 17 00:00:00 2001 From: Billy Bradley Date: Fri, 15 Oct 2021 16:37:13 +0100 Subject: Only clone spa_index when necessary --- src/config.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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, -- cgit v1.2.3