From 1168ac0458c7e92f22d1c77bf31daea4e23ac750 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Fri, 7 Feb 2020 20:10:31 +0000 Subject: Load the preshared keys on startup. --- src/manager/mod.rs | 9 ++++----- src/manager/updater.rs | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/manager') diff --git a/src/manager/mod.rs b/src/manager/mod.rs index 39e486c..646349a 100644 --- a/src/manager/mod.rs +++ b/src/manager/mod.rs @@ -58,12 +58,11 @@ impl Manager { fn current_load(&mut self) -> bool { let data = match fileutil::load(&self.state_path) { - Ok(Some(data)) => data, - Ok(None) => { - return false; - } + Ok(data) => data, Err(e) => { - eprintln!("<3>Failed to read interface state: {}", e); + if e.kind() != io::ErrorKind::NotFound { + eprintln!("<3>Failed to read interface state: {}", e); + } return false; } }; diff --git a/src/manager/updater.rs b/src/manager/updater.rs index db24d6e..ca04ce9 100644 --- a/src/manager/updater.rs +++ b/src/manager/updater.rs @@ -46,12 +46,11 @@ impl Updater { }; let data = match fileutil::load(&path) { - Ok(Some(data)) => data, - Ok(None) => { - return false; - } + Ok(data) => data, Err(e) => { - eprintln!("<3>Failed to read [{}] from cache: {}", &src.config.name, e); + if e.kind() != io::ErrorKind::NotFound { + eprintln!("<3>Failed to read [{}] from cache: {}", &src.config.name, e); + } return false; } }; -- cgit