From 52583ae9cec82301d0c9e26114d730afa3588d46 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 10 Jan 2021 13:21:44 +0000 Subject: [PATCH] shapelib: Load from Vec rather than config() This makes this function not tied to Config, which will be more suitable for otterlib. Signed-off-by: Ian Jackson --- daemon/main.rs | 2 +- src/shapelib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/main.rs b/daemon/main.rs index e8bf5ba6..505b17f4 100644 --- a/daemon/main.rs +++ b/daemon/main.rs @@ -269,7 +269,7 @@ fn main() { } nwtemplates::init()?; - shapelib::load()?; + shapelib::load(&config().shapelibs)?; c.lock_save_area()?; load_accounts()?; diff --git a/src/shapelib.rs b/src/shapelib.rs index df4054b3..3760e7ae 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -504,8 +504,8 @@ impl Config1 { } #[throws(LibraryLoadError)] -pub fn load() { - for l in &config().shapelibs { +pub fn load(libs: &Vec) { + for l in libs { let libs = l.resolve()?; let n = libs.len(); for e in libs { -- 2.30.2