From: Ian Jackson Date: Sun, 10 Jan 2021 13:21:44 +0000 (+0000) Subject: shapelib: Load from Vec rather than config() X-Git-Tag: otter-0.3.0~113 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=52583ae9cec82301d0c9e26114d730afa3588d46;p=otter.git 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 --- 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 {