aboutsummaryrefslogtreecommitdiff
path: root/src/manager
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2020-02-07 20:10:31 +0000
committerHristo Venev <hristo@venev.name>2020-02-07 20:11:50 +0000
commit1168ac0458c7e92f22d1c77bf31daea4e23ac750 (patch)
treeefff329fc504863c35d7b59955aaa20252adc2c8 /src/manager
parentaa3fa809befbda4c28cbc84730fbe3ef8fe23c22 (diff)
Load the preshared keys on startup.
Diffstat (limited to 'src/manager')
-rw-r--r--src/manager/mod.rs9
-rw-r--r--src/manager/updater.rs9
2 files changed, 8 insertions, 10 deletions
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;
}
};