diff options
| author | Nathan | 2017-07-22 18:58:13 -0400 | 
|---|---|---|
| committer | Nathan | 2017-07-22 18:58:13 -0400 | 
| commit | ff3f7c04139166b4b3ee5d17889129fbdb5fdff9 (patch) | |
| tree | 62ad046e6efc3af03e34056b2e16fbc627afb4ac | |
| parent | 5e6206f3a7b6c772ca94c0d6c8f615ba7d6ca8c6 (diff) | |
| download | podcast-ff3f7c04139166b4b3ee5d17889129fbdb5fdff9.tar.bz2 | |
Handle possible failure to save
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/main.rs | 4 | ||||
| -rw-r--r-- | src/structs.rs | 2 | 
3 files changed, 5 insertions, 3 deletions
| @@ -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()); | 
