From 11f5bd081bf303e96e79a9c3bd2c87855f1584e0 Mon Sep 17 00:00:00 2001 From: rabite Date: Sat, 29 Jun 2019 23:33:25 +0200 Subject: modularize media preview generator into own workspace --- src/widget.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/widget.rs') diff --git a/src/widget.rs b/src/widget.rs index 6cb19eb..8e2019d 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -192,9 +192,16 @@ impl WidgetCore { } pub fn config(&self) -> Config { - self.config.read().unwrap().get() - .map(|config| config.clone()) - .unwrap_or(Config::new()) + self.get_conf() + .unwrap_or_else(|_| Config::new()) + } + + fn get_conf(&self) -> HResult { + let conf = self.config + .read()? + .get()? + .clone(); + Ok(conf) } } -- cgit v1.2.3