From 131b739e4c44289db6308091cd4108b7694be761 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 29 May 2021 20:36:41 +0100 Subject: [PATCH] config: Break out libexec closure Signed-off-by: Ian Jackson --- src/config.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index ce97d696..336c1675 100644 --- a/src/config.rs +++ b/src/config.rs @@ -139,7 +139,6 @@ impl ServerConfigSpec { None => leaf.to_owned(), })) }; - let save_dir = defpath(save_dir, "save" ); let specs_dir = defpath(specs_dir, "specs" ); let command_socket = defpath(command_socket, "var/command.socket"); @@ -150,8 +149,10 @@ impl ServerConfigSpec { let bundled_sources = defpath(bundled_sources, "bundled-sources" ); const DEFAULT_LIBRARY_GLOB: &str = "library/*.toml"; - let usvg_bin = usvg_bin.unwrap_or_else( - || format!("{}/usvg", &libexec_dir)); + let libexec = |specd: Option, leaf: &str| -> String { + specd.unwrap_or_else(|| format!("{}/{}", &libexec_dir, leaf)) + }; + let usvg_bin = libexec(usvg_bin, "usvg"); let shapelibs = shapelibs.unwrap_or_else(||{ let glob = defpath(None, DEFAULT_LIBRARY_GLOB); -- 2.30.2