aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan2017-07-22 18:58:13 -0400
committerNathan2017-07-22 18:58:13 -0400
commitff3f7c04139166b4b3ee5d17889129fbdb5fdff9 (patch)
tree62ad046e6efc3af03e34056b2e16fbc627afb4ac
parent5e6206f3a7b6c772ca94c0d6c8f615ba7d6ca8c6 (diff)
downloadpodcast-ff3f7c04139166b4b3ee5d17889129fbdb5fdff9.tar.bz2
Handle possible failure to save
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs4
-rw-r--r--src/structs.rs2
3 files changed, 5 insertions, 3 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 5317aaf..e4b3c1a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "podcast"
-version = "0.2.2"
+version = "0.2.3"
authors = ["njaremko <njaremko@gmail.com>"]
description = "A command line podcast player"
license = "GPL-3.0"
diff --git a/src/main.rs b/src/main.rs
index 52ab321..6f23c6a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -123,5 +123,7 @@ fn main() {
Some("update") => update_rss(&state),
_ => (),
}
- state.save();
+ if let Err(err) = state.save() {
+ eprintln!("{}", err);
+ }
}
diff --git a/src/structs.rs b/src/structs.rs
index 0139394..e0088be 100644
--- a/src/structs.rs
+++ b/src/structs.rs
@@ -60,7 +60,7 @@ impl State {
});
}
if let Err(err) = self.save() {
- println!("{}", err);
+ eprintln!("{}", err);
}
// TODO only download new rss, don't refresh all
update_rss(&self.clone());